diff options
| author | Jason Cameron <git@jasoncameron.dev> | 2025-04-22 20:31:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-22 20:31:19 -0400 |
| commit | 78bb67fbf79bce6abed9d4e416ca1d10ed7dc12b (patch) | |
| tree | 160698d9ffa50eb2a2911b906dfa2c1feb976cf2 /internal/headers.go | |
| parent | 2db4105479e5920e983b15b0341104d6e572c1ea (diff) | |
| download | anubis-78bb67fbf79bce6abed9d4e416ca1d10ed7dc12b.tar.xz anubis-78bb67fbf79bce6abed9d4e416ca1d10ed7dc12b.zip | |
fix: improve error handling and create the json encoder once #331 (#332)
* fix: improve error handling for resource closing and JSON encoding in MakeChallenge
* chore: update CHANGELOG with recent changes and improvements
* refactor: simplify RenderIndex function and improve error handling
---------
Signed-off-by: Jason Cameron <git@jasoncameron.dev>
Diffstat (limited to 'internal/headers.go')
| -rw-r--r-- | internal/headers.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/headers.go b/internal/headers.go index bdb5e9e..eb7778b 100644 --- a/internal/headers.go +++ b/internal/headers.go @@ -73,7 +73,7 @@ func NoStoreCache(next http.Handler) http.Handler { }) } -// Do not allow browsing directory listings in paths that end with / +// NoBrowsing prevents directory browsing by returning a 404 for any request that ends with a "/". func NoBrowsing(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasSuffix(r.URL.Path, "/") { |
