From da1fe7c9d76a9c6a25bfa19ebd6cf8023eff5d62 Mon Sep 17 00:00:00 2001 From: Oleg Lobanov Date: Thu, 2 Nov 2023 22:23:20 +0100 Subject: [PATCH] fix: disable static resource files listing --- http/static.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http/static.go b/http/static.go index 9d1a0d35..469721e4 100644 --- a/http/static.go +++ b/http/static.go @@ -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))