Skip to content

Commit

Permalink
fix: disable static resource files listing
Browse files Browse the repository at this point in the history
  • Loading branch information
o1egl committed Nov 2, 2023
1 parent 7fabadc commit da1fe7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions http/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
return http.StatusNotFound, nil
}

if strings.HasSuffix(r.URL.Path, "/") {
return http.StatusNotFound, nil
}

const maxAge = 86400 // 1 day
w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%v", maxAge))

Expand Down

0 comments on commit da1fe7c

Please sign in to comment.