1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-19 21:17:58 +02:00

refactor c

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-10-21 11:30:39 -07:00
parent 76125a53e5
commit 2a9271d23f

View File

@ -545,15 +545,15 @@ func (e *Echo) ServeHTTP(req engine.Request, res engine.Response) {
c.Reset(req, res)
// Middleware
h := func(carg Context) error {
h := func(c Context) error {
method := req.Method()
path := req.URL().Path()
e.router.Find(method, path, c)
h := c.handler
h := c.Handler()
for i := len(e.middleware) - 1; i >= 0; i-- {
h = e.middleware[i](h)
}
return h(carg)
return h(c)
}
// Premiddleware