From 2f4d70bcd00a110b2fe00d56d463a7a2c93d09b0 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 30 Oct 2017 10:53:51 +0100 Subject: [PATCH] correct Cache-contol header missusage. --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index 97ba6765..71db9ddc 100644 --- a/server.go +++ b/server.go @@ -107,7 +107,7 @@ func respondWithImage(r *http.Request, rw http.ResponseWriter, data []byte, imgU gzipped := strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") && conf.GZipCompression > 0 rw.Header().Set("Expires", time.Now().Add(time.Second*time.Duration(conf.TTL)).Format(http.TimeFormat)) - rw.Header().Set("Cache-Control", fmt.Sprintf("Cache-Control: max-age=%d", conf.TTL)) + rw.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d, public", conf.TTL)) rw.Header().Set("Content-Type", mimes[po.format]) if gzipped { rw.Header().Set("Content-Encoding", "gzip")