From 801d7b3bd62dcf0e2f2aa6144e6930db08bf6c98 Mon Sep 17 00:00:00 2001 From: Yue Yang Date: Sun, 25 Apr 2021 17:29:42 +0800 Subject: [PATCH] Fix conflict between param and exact path Signed-off-by: Yue Yang --- tree.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tree.go b/tree.go index ca753e6d..a0df321f 100644 --- a/tree.go +++ b/tree.go @@ -411,8 +411,14 @@ walk: // Outer loop for walking the tree idxc := path[0] for i, c := range []byte(n.indices) { if c == idxc { - n = n.children[i] - continue walk + childWillWalkTo := n.children[i] + + if strings.Split(childWillWalkTo.path, "/")[0] != strings.Split(path, "/")[0] && strings.HasPrefix(n.children[len(n.children)-1].path, ":") { + continue + } else { + n = childWillWalkTo + continue walk + } } }