mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-30 14:15:40 +00:00
Mark cache as private
This commit is contained in:
@@ -201,7 +201,11 @@ func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if respJson.HaveTTL {
|
||||
w.Header().Set("Cache-Control", "max-age=" + strconv.Itoa(int(respJson.LeastTTL)))
|
||||
if ednsClientSubnet != "" {
|
||||
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("Expires", respJson.EarliestExpires.Format(time.RFC1123))
|
||||
}
|
||||
w.Write(respStr)
|
||||
|
||||
Reference in New Issue
Block a user