1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-11 14:49:56 +02:00

Update dummy group path to include exact prefix

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2017-12-23 09:11:03 -08:00
parent 8e421d9773
commit b338075a0f
2 changed files with 6 additions and 4 deletions

View File

@ -213,7 +213,7 @@ const (
)
const (
version = "3.2.5"
version = "3.2.6"
website = "https://echo.labstack.com"
// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
banner = `

View File

@ -20,9 +20,11 @@ func (g *Group) Use(middleware ...MiddlewareFunc) {
g.middleware = append(g.middleware, middleware...)
// 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(path.Clean(g.prefix+"/*"), func(c Context) error {
return NotFoundHandler(c)
}, g.middleware...)
for _, p := range []string{"", "/*"} {
g.echo.Any(path.Clean(g.prefix+p), func(c Context) error {
return NotFoundHandler(c)
}, g.middleware...)
}
}
// CONNECT implements `Echo#CONNECT()` for sub-routes within the Group.