Merge 125ccfc6efbd7ff830a5441c0fb6a0fd27790ac0 into 44d0dd70924dd154e3b98bc340accc53484efa9c

This commit is contained in:
Luke Wilson 2023-11-19 07:49:48 -07:00 committed by GitHub
commit ee7761c053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,7 +351,11 @@ func (n *node) insertChild(path string, fullPath string, handlers HandlersChain)
}
if len(n.path) > 0 && n.path[len(n.path)-1] == '/' {
pathSeg := strings.SplitN(n.children[0].path, "/", 2)[0]
// Wildcard conflict
pathSeg := path
if len(n.children) != 0 {
pathSeg = strings.SplitN(n.children[0].path, "/", 2)[0]
}
panic("catch-all wildcard '" + path +
"' in new path '" + fullPath +
"' conflicts with existing path segment '" + pathSeg +