diff options
author | Wim <wim@42.be> | 2017-06-06 00:01:05 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-06-06 00:04:18 +0200 |
commit | 3a183cb218c6812964a70d2e75884ad7071d9c0c (patch) | |
tree | ee0d2492c27e84ace88acfcfdc533545f42ccb21 /vendor/github.com/labstack/echo/group.go | |
parent | 2eecaccd1c77e8990a80e6b4b6ad6b13a9c95896 (diff) | |
download | matterbridge-msglm-3a183cb218c6812964a70d2e75884ad7071d9c0c.tar.gz matterbridge-msglm-3a183cb218c6812964a70d2e75884ad7071d9c0c.tar.bz2 matterbridge-msglm-3a183cb218c6812964a70d2e75884ad7071d9c0c.zip |
Update vendor
Diffstat (limited to 'vendor/github.com/labstack/echo/group.go')
-rw-r--r-- | vendor/github.com/labstack/echo/group.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/github.com/labstack/echo/group.go b/vendor/github.com/labstack/echo/group.go index 9767bb19..799a8f90 100644 --- a/vendor/github.com/labstack/echo/group.go +++ b/vendor/github.com/labstack/echo/group.go @@ -1,8 +1,12 @@ package echo +import ( + "path" +) + type ( // Group is a set of sub-routes for a specified route. It can be used for inner - // routes that share a common middlware or functionality that should be separate + // routes that share a common middleware or functionality that should be separate // from the parent echo instance while still inheriting from it. Group struct { prefix string @@ -14,6 +18,11 @@ type ( // Use implements `Echo#Use()` for sub-routes within the Group. 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 ErrNotFound + }, g.middleware...) } // CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. |