Merge 8da51b6c82414b2c4b92eed136251e2fbac290db into a331dc6a31473b7208c57ec32e14bfcec3062dbb

This commit is contained in:
ffhelicopter 2021-03-27 20:35:57 +05:30 committed by GitHub
commit bf8ca36d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {