From 5c498ae4df7c1d1f1c6fb19eb151ba29287d7e1d Mon Sep 17 00:00:00 2001 From: Lucas Serven Date: Wed, 26 Oct 2016 14:58:18 -0700 Subject: [PATCH] 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. --- server/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/handlers.go b/server/handlers.go index 83ef5376..00dbe82e 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -84,7 +84,7 @@ func (s *Server) handlePublicKeys(w http.ResponseWriter, r *http.Request) { 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-Length", strconv.Itoa(len(data))) w.Write(data)