Ensure auth is checked after all other middleware

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-14 13:24:48 +00:00
parent cd20e647a0
commit e66435258e

View file

@ -36,13 +36,15 @@ func Setup(opts *cnf.Options) (err error) {
// Setup middleware // Setup middleware
s.Use(auth()) // Setup auth
s.Use(mw.Logs()) // Log requests s.Use(mw.Logs()) // Log requests
s.Use(mw.Fail()) // Catch panics s.Use(mw.Fail()) // Catch panics
s.Use(mw.Gzip()) // Gzip responses s.Use(mw.Gzip()) // Gzip responses
s.Use(mw.Uniq()) // Add uniq headers s.Use(mw.Uniq()) // Add uniq headers
s.Use(mw.Cors()) // Add cors headers s.Use(mw.Cors()) // Add cors headers
// Setup authentication
s.Use(auth())
// Check body size // Check body size
s.Use(mw.Size(&mw.SizeOpts{ s.Use(mw.Size(&mw.SizeOpts{