diff options
author | Wim <wim@42.be> | 2019-09-07 22:46:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-07 22:46:58 +0200 |
commit | a3bee01e0af3394c19360b98fd2db1b647f49299 (patch) | |
tree | ffc5778361d55d592a718354a37c9251e75fc7f6 /vendor/github.com/labstack/echo/v4/router.go | |
parent | 1dc93ec4f001edd01daccbe408767d4878be25a3 (diff) | |
download | matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.gz matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.bz2 matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.zip |
Update dependencies (#886)
Diffstat (limited to 'vendor/github.com/labstack/echo/v4/router.go')
-rw-r--r-- | vendor/github.com/labstack/echo/v4/router.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vendor/github.com/labstack/echo/v4/router.go b/vendor/github.com/labstack/echo/v4/router.go index 8d3a0180..70bf409f 100644 --- a/vendor/github.com/labstack/echo/v4/router.go +++ b/vendor/github.com/labstack/echo/v4/router.go @@ -20,8 +20,8 @@ type ( pnames []string methodHandler *methodHandler } - kind uint8 - children []*node + kind uint8 + children []*node methodHandler struct { connect HandlerFunc delete HandlerFunc @@ -336,10 +336,14 @@ func (r *Router) Find(method, path string, c Context) { } } + if l == pl { // Continue search search = search[l:] } else { + if nn == nil { // Issue #1348 + return // Not found + } cn = nn search = ns if nk == pkind { @@ -347,8 +351,6 @@ func (r *Router) Find(method, path string, c Context) { } else if nk == akind { goto Any } - // Not found - return } if search == "" { @@ -398,6 +400,9 @@ func (r *Router) Find(method, path string, c Context) { if nn != nil { cn = nn nn = cn.parent // Next (Issue #954) + if nn != nil { + nk = nn.kind + } search = ns if nk == pkind { goto Param @@ -405,8 +410,7 @@ func (r *Router) Find(method, path string, c Context) { goto Any } } - // Not found - return + return // Not found } pvalues[len(cn.pnames)-1] = search break |