mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 01:12:16 +08:00
Update tree.go
This commit is contained in:
parent
09956d42fa
commit
028cb5508f
6
tree.go
6
tree.go
@ -187,9 +187,11 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
|
||||
numParams--
|
||||
|
||||
// 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
|
||||
continue walk
|
||||
if len(n.path) >= len(path) || path[len(n.path)] == '/' {
|
||||
continue walk
|
||||
}
|
||||
} else {
|
||||
// Wildcard conflict
|
||||
pathSeg := path
|
||||
|
Loading…
x
Reference in New Issue
Block a user