Skip to content
Snippets Groups Projects
Commit 5c498ae4 authored by Lucas Serven's avatar Lucas Serven
Browse files

server/handlers: fix Cache-Control header

fixes: #636

This commit addresses a problem where the `max-age` value is being set
in nanoseconds as opposed to seconds, as required by the specification.
parent 99e312ea
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ func (s *Server) handlePublicKeys(w http.ResponseWriter, r *http.Request) { ...@@ -84,7 +84,7 @@ func (s *Server) handlePublicKeys(w http.ResponseWriter, r *http.Request) {
maxAge = time.Minute * 2 maxAge = time.Minute * 2
} }
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d, must-revalidate", maxAge)) w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d, must-revalidate", int(maxAge.Seconds())))
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
w.Header().Set("Content-Length", strconv.Itoa(len(data))) w.Header().Set("Content-Length", strconv.Itoa(len(data)))
w.Write(data) w.Write(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment