fix: disable static resource files listing

pull/2800/head
Oleg Lobanov 2023-11-02 22:23:20 +01:00
parent 7fabadc871
commit da1fe7c9d7
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -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))