mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 22:32:26 +08:00
Merge 8da51b6c82414b2c4b92eed136251e2fbac290db into a331dc6a31473b7208c57ec32e14bfcec3062dbb
This commit is contained in:
commit
bf8ca36d34
8
tree.go
8
tree.go
@ -400,10 +400,12 @@ type nodeValue struct {
|
|||||||
func (n *node) getValue(path string, params *Params, unescape bool) (value nodeValue) {
|
func (n *node) getValue(path string, params *Params, unescape bool) (value nodeValue) {
|
||||||
walk: // Outer loop for walking the tree
|
walk: // Outer loop for walking the tree
|
||||||
for {
|
for {
|
||||||
|
|
||||||
prefix := n.path
|
prefix := n.path
|
||||||
if len(path) > len(prefix) {
|
if len(path) > len(prefix) {
|
||||||
if path[:len(prefix)] == prefix {
|
if strings.ToLower(path[:len(prefix)]) == strings.ToLower(prefix) {
|
||||||
path = path[len(prefix):]
|
path = path[len(prefix):]
|
||||||
|
|
||||||
// If this node does not have a wildcard (param or catchAll)
|
// If this node does not have a wildcard (param or catchAll)
|
||||||
// child, we can just look up the next child node and continue
|
// child, we can just look up the next child node and continue
|
||||||
// to walk down the tree
|
// to walk down the tree
|
||||||
@ -507,9 +509,11 @@ walk: // Outer loop for walking the tree
|
|||||||
panic("invalid node type")
|
panic("invalid node type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if path == prefix {
|
if strings.ToLower(path) == strings.ToLower(prefix) {
|
||||||
|
|
||||||
// We should have reached the node containing the handle.
|
// We should have reached the node containing the handle.
|
||||||
// Check if this node has a handle registered.
|
// Check if this node has a handle registered.
|
||||||
if value.handlers = n.handlers; value.handlers != nil {
|
if value.handlers = n.handlers; value.handlers != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user