diff options
| author | Leonardo Bishop <me@leonardobishop.net> | 2025-07-18 00:01:00 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.net> | 2025-07-18 00:01:00 +0100 |
| commit | 7cef9a07172e8edfb48f9260749755ec9e886e98 (patch) | |
| tree | b2216f89321ba6c598d83f22fdd0c96a3ac642bf /pkg/site/fs.go | |
| parent | c7c3e1437bd92982937ba6ce6b46a002077912c0 (diff) | |
Change trailing slash redirect to 302 Found
Diffstat (limited to 'pkg/site/fs.go')
| -rw-r--r-- | pkg/site/fs.go | 4 |
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") |
