all repos — homestead @ 59aa24e05234e5e4edd01ff6902c88b837a2e746

Code for my website

redirect /foo/ -> /foo iff /foo exists

Alan Pearce
commit

59aa24e05234e5e4edd01ff6902c88b837a2e746

parent

543bd2479e0f414cf4adc9e83a4e47052d55f5be

1 file changed, 5 insertions(+), 0 deletions(-)

jump to
M internal/storage/files/reader.gointernal/storage/files/reader.go
@@ -88,6 +88,11 @@
case !strings.HasSuffix(path, "/") && r.files[path+"/"] != nil: cPath, differs = path+"/", true + case strings.HasSuffix(path, "/"): + if cPath, differs = strings.CutSuffix(path, "/"); differs && r.files[cPath] != nil { + return cPath, differs + } + } return cPath, differs