From 7cef9a07172e8edfb48f9260749755ec9e886e98 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Fri, 18 Jul 2025 00:01:00 +0100 Subject: Change trailing slash redirect to 302 Found --- pkg/site/fs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/site/fs.go b/pkg/site/fs.go index 11b36cf..ec57318 100644 --- a/pkg/site/fs.go +++ b/pkg/site/fs.go @@ -50,8 +50,8 @@ func (fs *SiteFileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if info.IsDir() { - if !strings.HasSuffix(path, "/") { - http.Redirect(w, r, path+"/", http.StatusTemporaryRedirect) + if !strings.HasSuffix(r.URL.Path, "/") { + http.Redirect(w, r, path+"/", http.StatusFound) return } indexPath := filepath.Join(path, "index.html") -- cgit v1.2.3-70-g09d2