diff --git a/doh-server/google.go b/doh-server/google.go index 9ab6607..e670de0 100644 --- a/doh-server/google.go +++ b/doh-server/google.go @@ -180,9 +180,9 @@ func (s *Server) generateResponseGoogle(w http.ResponseWriter, r *http.Request, w.Header().Set("Content-Type", "application/json; charset=UTF-8") if respJSON.HaveTTL { if req.isTailored { - w.Header().Set("Cache-Control", "public, max-age="+strconv.Itoa(int(respJSON.LeastTTL))) - } else { w.Header().Set("Cache-Control", "private, max-age="+strconv.Itoa(int(respJSON.LeastTTL))) + } else { + w.Header().Set("Cache-Control", "public, max-age="+strconv.Itoa(int(respJSON.LeastTTL))) } w.Header().Set("Expires", respJSON.EarliestExpires.Format(http.TimeFormat)) } diff --git a/doh-server/ietf.go b/doh-server/ietf.go index fec2c6f..981d402 100644 --- a/doh-server/ietf.go +++ b/doh-server/ietf.go @@ -150,9 +150,9 @@ func (s *Server) generateResponseIETF(w http.ResponseWriter, r *http.Request, re w.Header().Set("Last-Modified", now) if respJSON.HaveTTL { if req.isTailored { - w.Header().Set("Cache-Control", "public, max-age="+strconv.Itoa(int(respJSON.LeastTTL))) - } else { w.Header().Set("Cache-Control", "private, max-age="+strconv.Itoa(int(respJSON.LeastTTL))) + } else { + w.Header().Set("Cache-Control", "public, max-age="+strconv.Itoa(int(respJSON.LeastTTL))) } w.Header().Set("Expires", respJSON.EarliestExpires.Format(http.TimeFormat)) }