From 257a777e030bab29ae8f5779465f97ded46ce871 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 26 May 2022 17:05:47 +0200 Subject: [PATCH] Add Cache-Control for authenticated pages --- cmd/boardvoting/middleware.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/boardvoting/middleware.go b/cmd/boardvoting/middleware.go index 030883e..5326f05 100644 --- a/cmd/boardvoting/middleware.go +++ b/cmd/boardvoting/middleware.go @@ -88,6 +88,8 @@ func (app *application) tryAuthenticate(next http.Handler) http.Handler { return } + w.Header().Add("Cache-Control", "no-store") + next.ServeHTTP(w, r.WithContext(context.WithValue(r.Context(), ctxUser, user))) }) }