mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-10-23 19:32:33 +00:00
Fix cache privateness
This commit is contained in:
1 parent
2b3a261247
commit
1be3052cda
2 files changed
+4
-4
No files matched your search
@@ -180,9 +180,9 @@ func (s *Server) generateResponseGoogle(w http.ResponseWriter, r *http.Request,
|
|||||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||||
if respJSON.HaveTTL {
|
if respJSON.HaveTTL {
|
||||||
if req.isTailored {
|
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)))
|
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))
|
w.Header().Set("Expires", respJSON.EarliestExpires.Format(http.TimeFormat))
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -150,9 +150,9 @@ func (s *Server) generateResponseIETF(w http.ResponseWriter, r *http.Request, re
|
|||||||
w.Header().Set("Last-Modified", now)
|
w.Header().Set("Last-Modified", now)
|
||||||
if respJSON.HaveTTL {
|
if respJSON.HaveTTL {
|
||||||
if req.isTailored {
|
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)))
|
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))
|
w.Header().Set("Expires", respJSON.EarliestExpires.Format(http.TimeFormat))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user