Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ walk: // Outer loop for walking the tree
return nil
}

n = n.children[0]
n = n.children[len(n.children)-1]
switch n.nType {
case param:
// Find param end (either '/' or path end)
Expand Down
3 changes: 3 additions & 0 deletions tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
"/w/𠜎", // 4 byte
"/w/𠜏/", // 4 byte
longPath,
"/param/same/:id",
"/param/same/1",
}

for _, route := range routes {
Expand Down Expand Up @@ -844,6 +846,7 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
{"/w/𠜎/", "/w/𠜎", true, true},
{"/w/𠜏", "/w/𠜏/", true, true},
{lOngPath, longPath, true, true},
{"/param/same/prefix/noexist", "", false, false},
}
// With fixTrailingSlash = true
for _, test := range tests {
Expand Down