From fc6263371d8408369cb93c5846038041f06dad4b Mon Sep 17 00:00:00 2001 From: citizen233 Date: Sun, 29 Aug 2021 21:09:20 +0800 Subject: [PATCH] fix the misplacement of adding slashes --- tree.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree.go b/tree.go index fb0a5935c2..e13be813fc 100644 --- a/tree.go +++ b/tree.go @@ -599,7 +599,7 @@ walk: // Outer loop for walking the tree // Nothing found. We can recommend to redirect to the same URL with an // extra trailing slash if a leaf exists for that path value.tsr = path == "/" || - (len(prefix) == len(path)+1 && n.handlers != nil) + (len(prefix) == len(path)+1 && path == prefix[:len(prefix) - 1] && n.handlers != nil) return } }