Skip to content

Commit ee53041

Browse files
committed
feat(serverHandler/page): output Cache-Control only if not set
1 parent 10ffec1 commit ee53041

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/serverHandler/page.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ func (h *aliasHandler) page(w http.ResponseWriter, r *http.Request, data *respon
6666
header := w.Header()
6767
header.Set("X-Content-Type-Options", "nosniff")
6868
header.Set("Content-Type", "text/html; charset=utf-8")
69-
header.Set("Cache-Control", "public, max-age=0")
69+
if len(header.Values("Cache-Control")) == 0 {
70+
header.Set("Cache-Control", "public, max-age=0")
71+
}
7072

7173
if r.ProtoMajor <= 1 {
7274
header.Set("Vary", h.pageVaryV1)

0 commit comments

Comments
 (0)