Skip to content

Commit

Permalink
fixed #623
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <vr@labstack.com>
  • Loading branch information
vishr committed Oct 14, 2016
1 parent 60ce130 commit 2bdbf69
Show file tree
Hide file tree
Showing 3 changed files with 181 additions and 144 deletions.
5 changes: 5 additions & 0 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +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...)
}

// CONNECT implements `Echo#CONNECT()` for sub-routes within the Group.
Expand Down
4 changes: 2 additions & 2 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func (r *Router) Find(method, path string, context Context) {
// Static node
if c = cn.findChild(search[0], skind); c != nil {
// Save next
if cn.label == '/' {
if cn.prefix[len(cn.prefix)-1] == '/' { // Issue #623
nk = pkind
nn = cn
ns = search
Expand All @@ -361,7 +361,7 @@ func (r *Router) Find(method, path string, context Context) {
}

// Save next
if cn.label == '/' {
if cn.prefix[len(cn.prefix)-1] == '/' { // Issue #623
nk = akind
nn = cn
ns = search
Expand Down
Loading

0 comments on commit 2bdbf69

Please sign in to comment.