mirror of
https://github.com/labstack/echo.git
synced 2024-11-24 08:22:21 +02:00
Moving some logic around
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
51a1ef432c
commit
c0571e37c3
15
router.go
15
router.go
@ -285,7 +285,7 @@ func (r *Router) Find(method, path string, ctx *Context) (h HandlerFunc, e *Echo
|
||||
|
||||
// Strip trailing slash
|
||||
if r.echo.stripTrailingSlash {
|
||||
l := len(path)-1
|
||||
l := len(path) - 1
|
||||
if path != "/" && path[l] == '/' { // Issue #218
|
||||
path = path[:l]
|
||||
}
|
||||
@ -386,15 +386,12 @@ func (r *Router) Find(method, path string, ctx *Context) (h HandlerFunc, e *Echo
|
||||
// Match-any node
|
||||
MatchAny:
|
||||
// c = cn.getChild()
|
||||
c = cn.findChildWithType(mtype)
|
||||
if c != nil {
|
||||
cn = c
|
||||
ctx.pvalues[len(cn.pnames)-1] = search
|
||||
goto Found
|
||||
if cn = cn.findChildWithType(mtype); cn == nil {
|
||||
// Not found
|
||||
return
|
||||
}
|
||||
|
||||
// Not found
|
||||
return
|
||||
ctx.pvalues[len(cn.pnames)-1] = search
|
||||
goto Found
|
||||
}
|
||||
|
||||
Found:
|
||||
|
Loading…
Reference in New Issue
Block a user