Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case insensitivity #2064

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions tree.go
Expand Up @@ -396,10 +396,12 @@ type nodeValue struct {
func (n *node) getValue(path string, params *Params, unescape bool) (value nodeValue) {
walk: // Outer loop for walking the tree
for {

prefix := n.path
if len(path) > len(prefix) {
if path[:len(prefix)] == prefix {
if strings.ToLower(path[:len(prefix)]) == strings.ToLower(prefix) {
path = path[len(prefix):]

// If this node does not have a wildcard (param or catchAll)
// child, we can just look up the next child node and continue
// to walk down the tree
Expand Down Expand Up @@ -503,9 +505,11 @@ walk: // Outer loop for walking the tree
panic("invalid node type")
}
}

}

if path == prefix {
if strings.ToLower(path) == strings.ToLower(prefix) {

// We should have reached the node containing the handle.
// Check if this node has a handle registered.
if value.handlers = n.handlers; value.handlers != nil {
Expand Down