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:
parent
2d1ce165a5
commit
909ce9386d
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue