mirror of
https://github.com/coredns/coredns.git
synced 2025-10-26 15:54:16 -04:00
core: set cache-control max-age as integer, not float (#6764)
As specified in rfc2616, the max-age is an integer. Setting a float might make the header get ignored in some cases.
This commit is contained in:
@@ -188,7 +188,7 @@ func (s *ServerHTTPS) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
age := dnsutil.MinimalTTL(dw.Msg, mt)
|
||||
|
||||
w.Header().Set("Content-Type", doh.MimeType)
|
||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%f", age.Seconds()))
|
||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d", uint32(age.Seconds())))
|
||||
w.Header().Set("Content-Length", strconv.Itoa(len(buf)))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
s.countResponse(http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user