1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-10-22 12:32:39 -07:00
parent 36251e88e2
commit 12573cd76d
2 changed files with 7 additions and 5 deletions

View File

@ -16,11 +16,11 @@ type (
// Use implements `Echo#Use()` for sub-routes within the Group.
func (g *Group) Use(m ...MiddlewareFunc) {
g.middleware = append(g.middleware, m...)
// Allow all requests to reach the group as they might get dropped if router
// doesn't find a match, making none of the group middleware process.
g.echo.Any(g.prefix+"*", func(c Context) error {
return ErrNotFound
}, g.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.
g.echo.Any(g.prefix, NotFoundHandler, g.middleware...)
g.echo.Any(g.prefix+"/*", NotFoundHandler, g.middleware...)
}
// CONNECT implements `Echo#CONNECT()` for sub-routes within the Group.

2
website/Makefile Normal file
View File

@ -0,0 +1,2 @@
build:
rm -rf public && hugo