mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +08:00
fix: catch-all conflicting wildcard
This commit is contained in:
parent
53fbf4dbfb
commit
802125c83d
5
tree.go
5
tree.go
@ -351,7 +351,10 @@ func (n *node) insertChild(path string, fullPath string, handlers HandlersChain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(n.path) > 0 && n.path[len(n.path)-1] == '/' {
|
if len(n.path) > 0 && n.path[len(n.path)-1] == '/' {
|
||||||
pathSeg := strings.SplitN(n.children[0].path, "/", 2)[0]
|
pathSeg := ""
|
||||||
|
if len(n.children) != 0 {
|
||||||
|
pathSeg = strings.SplitN(n.children[0].path, "/", 2)[0]
|
||||||
|
}
|
||||||
panic("catch-all wildcard '" + path +
|
panic("catch-all wildcard '" + path +
|
||||||
"' in new path '" + fullPath +
|
"' in new path '" + fullPath +
|
||||||
"' conflicts with existing path segment '" + pathSeg +
|
"' conflicts with existing path segment '" + pathSeg +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user