mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 05:42:09 +08:00
Fix conflict between param and exact path
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
This commit is contained in:
parent
c0418c48e4
commit
801d7b3bd6
10
tree.go
10
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user