mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 09:34:33 +08:00
Update tree.go
This commit is contained in:
parent
09956d42fa
commit
028cb5508f
4
tree.go
4
tree.go
@ -187,9 +187,11 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
|
|||||||
numParams--
|
numParams--
|
||||||
|
|
||||||
// Check if the wildcard matches
|
// Check if the wildcard matches
|
||||||
if len(path) >= len(n.path) && n.path == path[:len(n.path)] && (len(n.path) >= len(path) || path[len(n.path)] == '/') {
|
if len(path) >= len(n.path) && n.path == path[:len(n.path)] {
|
||||||
// check for longer wildcard, e.g. :name and :names
|
// check for longer wildcard, e.g. :name and :names
|
||||||
|
if len(n.path) >= len(path) || path[len(n.path)] == '/' {
|
||||||
continue walk
|
continue walk
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Wildcard conflict
|
// Wildcard conflict
|
||||||
pathSeg := path
|
pathSeg := path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user