From 30d8016d0ccbea6d899d01cef1167e5cfc5bb0cc Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 19 Feb 2017 19:36:29 +0000 Subject: [PATCH] Reorder middleware --- web/web.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/web.go b/web/web.go index dc4be614..48269ebe 100644 --- a/web/web.go +++ b/web/web.go @@ -17,6 +17,7 @@ package web import ( "github.com/abcum/fibre" "github.com/abcum/fibre/mw" + "github.com/abcum/surreal/cnf" "github.com/abcum/surreal/log" ) @@ -36,10 +37,11 @@ func Setup(opts *cnf.Options) (err error) { // Setup middleware - s.Use(mw.Logs()) // Log requests + s.Use(mw.Uniq()) // Add uniq id s.Use(mw.Fail()) // Catch panics + s.Use(mw.Logs()) // Log requests + s.Use(mw.Sock()) // Log requests s.Use(mw.Gzip()) // Gzip responses - s.Use(mw.Uniq()) // Add uniq headers s.Use(mw.Cors()) // Add cors headers // Setup authentication