From 76125a53e5e677969011ae3a1bd767de74c76204 Mon Sep 17 00:00:00 2001 From: Russ Egan Date: Fri, 21 Oct 2016 14:08:56 -0400 Subject: [PATCH] Fix for #681 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Premiddleware may embed the echo context in their own custom context. Therefore, it’s important to pass the context flowing down from the premiddleware chain down through the rest of the chain. --- echo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/echo.go b/echo.go index 648057be..86f836b8 100644 --- a/echo.go +++ b/echo.go @@ -545,7 +545,7 @@ func (e *Echo) ServeHTTP(req engine.Request, res engine.Response) { c.Reset(req, res) // Middleware - h := func(Context) error { + h := func(carg Context) error { method := req.Method() path := req.URL().Path() e.router.Find(method, path, c) @@ -553,7 +553,7 @@ func (e *Echo) ServeHTTP(req engine.Request, res engine.Response) { for i := len(e.middleware) - 1; i >= 0; i-- { h = e.middleware[i](h) } - return h(c) + return h(carg) } // Premiddleware