Run auth middleware just before gzip middleware

This commit is contained in:
Tobie Morgan Hitchcock 2017-11-16 20:50:52 +00:00
parent 33ab1efb08
commit 1ee95333fb

View file

@ -47,10 +47,6 @@ func Setup(opts *cnf.Options) (err error) {
s.Use(tracer()) s.Use(tracer())
// Setup authentication
s.Use(auth())
// Add cors headers // Add cors headers
s.Use(mw.Cors(&mw.CorsOpts{ s.Use(mw.Cors(&mw.CorsOpts{
@ -81,6 +77,10 @@ func Setup(opts *cnf.Options) (err error) {
AllowedLength: 1 << 20, // 1mb AllowedLength: 1 << 20, // 1mb
})) }))
// Setup authentication
s.Use(auth())
// Compress responses // Compress responses
s.Use(mw.Gzip()) s.Use(mw.Gzip())