From e66435258eb04854184f52eeeb4c090ee5f33464 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 14 Nov 2016 13:24:48 +0000 Subject: [PATCH] Ensure auth is checked after all other middleware --- web/web.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index a333228e..c98f51cd 100644 --- a/web/web.go +++ b/web/web.go @@ -36,13 +36,15 @@ func Setup(opts *cnf.Options) (err error) { // Setup middleware - s.Use(auth()) // Setup auth s.Use(mw.Logs()) // Log requests s.Use(mw.Fail()) // Catch panics s.Use(mw.Gzip()) // Gzip responses s.Use(mw.Uniq()) // Add uniq headers s.Use(mw.Cors()) // Add cors headers + // Setup authentication + s.Use(auth()) + // Check body size s.Use(mw.Size(&mw.SizeOpts{