Fix conflict between param and exact path

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
This commit is contained in:
Yue Yang 2021-04-25 17:29:42 +08:00
parent c0418c48e4
commit 801d7b3bd6

10
tree.go
View File

@ -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
}
}
}