File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ walk: // Outer loop for walking the tree
393
393
// No handle found. Check if a handle for this path + a
394
394
// trailing slash exists for TSR recommendation
395
395
n = n .children [0 ]
396
- tsr = (n .path == "/" && n .handle != nil )
396
+ tsr = (n .path == "/" && n .handle != nil ) || ( n . path == "" && n . indices == "/" )
397
397
}
398
398
399
399
return
Original file line number Diff line number Diff line change @@ -392,6 +392,7 @@ func TestTreeTrailingSlashRedirect(t *testing.T) {
392
392
"/no/a" ,
393
393
"/no/b" ,
394
394
"/api/hello/:name" ,
395
+ "/vendor/:x/*y" ,
395
396
}
396
397
for i := range routes {
397
398
route := routes [i ]
@@ -420,6 +421,7 @@ func TestTreeTrailingSlashRedirect(t *testing.T) {
420
421
"/admin/config/" ,
421
422
"/admin/config/permissions/" ,
422
423
"/doc/" ,
424
+ "/vendor/x" ,
423
425
}
424
426
for _ , route := range tsrRoutes {
425
427
handler , _ , tsr := tree .getValue (route , nil )
You can’t perform that action at this time.
0 commit comments