mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-30 20:45:38 +00:00
Fix cache privateness
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user