mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Fix duplicate code
This commit is contained in:
parent
e125b2cf84
commit
546639c8d0
6
echo.go
6
echo.go
@ -504,11 +504,7 @@ func (e *Echo) add(host, method, path string, handler HandlerFunc, middleware ..
|
||||
name := handlerName(handler)
|
||||
router := e.findRouter(host)
|
||||
router.Add(method, path, func(c Context) error {
|
||||
h := handler
|
||||
// Chain middleware
|
||||
for i := len(middleware) - 1; i >= 0; i-- {
|
||||
h = middleware[i](h)
|
||||
}
|
||||
h := applyMiddleware(handler, middleware...)
|
||||
return h(c)
|
||||
})
|
||||
r := &Route{
|
||||
|
Loading…
Reference in New Issue
Block a user