1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-28 08:38:39 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-10-30 13:29:37 -07:00
parent 58166d599b
commit 796df515f3

View File

@ -14,18 +14,6 @@ type (
// Use implements `Echo#Use()` for sub-routes within the Group.
func (g *Group) Use(middleware ...MiddlewareFunc) {
g.middleware = append(g.middleware, middleware...)
// Allow requests `/prefix & /prefix/*` to reach the group as they might get
// dropped if router doesn't find a match, making none of the group middleware
// execute.
paths := []string{"/*"}
if g.prefix == "" {
paths = append(paths, "/")
} else {
paths = append(paths, "")
}
for _, p := range paths {
g.Any(p, NotFoundHandler, g.middleware...)
}
}
// CONNECT implements `Echo#CONNECT()` for sub-routes within the Group.