Skip to content

Commit

Permalink
Fix duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
BUGLAN committed Jul 8, 2020
1 parent e125b2c commit 546639c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 546639c

Please sign in to comment.