aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/site
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-07-18 00:01:00 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-07-18 00:01:00 +0100
commit7cef9a07172e8edfb48f9260749755ec9e886e98 (patch)
treeb2216f89321ba6c598d83f22fdd0c96a3ac642bf /pkg/site
parentc7c3e1437bd92982937ba6ce6b46a002077912c0 (diff)
Change trailing slash redirect to 302 Found
Diffstat (limited to 'pkg/site')
-rw-r--r--pkg/site/fs.go4
1 files 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")