aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/headers.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/headers.go b/internal/headers.go
index a48ce54..5c6a218 100644
--- a/internal/headers.go
+++ b/internal/headers.go
@@ -64,6 +64,15 @@ func XForwardedForToXRealIP(next http.Handler) http.Handler {
})
}
+// NoStoreCache sets the Cache-Control header to no-store for the response.
+func NoStoreCache(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "no-store")
+ next.ServeHTTP(w, r)
+ })
+}
+
+
// Do not allow browsing directory listings in paths that end with /
func NoBrowsing(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {