diff --git a/app.go b/app.go index 07d53114b..2942acdff 100644 --- a/app.go +++ b/app.go @@ -9,7 +9,6 @@ import ( "sync" "syscall" - gcontext "github.com/gorilla/context" "github.com/gorilla/mux" "github.com/markbates/refresh/refresh/web" "github.com/markbates/sigtx" @@ -101,7 +100,6 @@ func (a *App) Stop(err error) error { } func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) { - defer gcontext.Clear(r) ws := &Response{ ResponseWriter: w, } diff --git a/handler.go b/handler.go index e755b823b..9d22dc0e4 100644 --- a/handler.go +++ b/handler.go @@ -3,6 +3,7 @@ package buffalo import ( "net/http" + gcontext "github.com/gorilla/context" "github.com/gorilla/mux" "github.com/pkg/errors" ) @@ -63,6 +64,7 @@ func (a *App) newContext(info RouteInfo, res http.ResponseWriter, req *http.Requ } func (info RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { + defer gcontext.Clear(req) a := info.App c := a.newContext(info, res, req)