Ensure that gzip is the final middleware to be initialised
This commit is contained in:
parent
8f06b958ff
commit
33ab1efb08
1 changed files with 4 additions and 1 deletions
|
@ -42,7 +42,6 @@ func Setup(opts *cnf.Options) (err error) {
|
|||
s.Use(mw.Fail()) // Catch panics
|
||||
s.Use(mw.Logs()) // Log requests
|
||||
s.Use(mw.Sock()) // Log requests
|
||||
s.Use(mw.Gzip()) // Gzip responses
|
||||
|
||||
// Add trace information
|
||||
|
||||
|
@ -82,6 +81,10 @@ func Setup(opts *cnf.Options) (err error) {
|
|||
AllowedLength: 1 << 20, // 1mb
|
||||
}))
|
||||
|
||||
// Compress responses
|
||||
|
||||
s.Use(mw.Gzip())
|
||||
|
||||
// Log successful start
|
||||
|
||||
log.WithPrefix("web").Infof("Started web server on %s", opts.Conn.Web)
|
||||
|
|
Loading…
Reference in a new issue