Skip to content

Commit

Permalink
Fix cache header notation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanvugt committed Dec 6, 2023
1 parent eef5dd8 commit 3aa3861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ func withCaching(wrappedHandler http.HandlerFunc) http.HandlerFunc {
}

return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age:%s", cacheControlMaxAgeSeconds))
w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%s", cacheControlMaxAgeSeconds))

// Set etag based on URL path and App Version
etagString := fmt.Sprintf("%s/%s", appVersion, r.URL.Path)
w.Header().Set("Etag", fmt.Sprintf("%x", md5.Sum([]byte(etagString))))
w.Header().Set("Etag", fmt.Sprintf(`"%x"`, md5.Sum([]byte(etagString))))

wrappedHandler(w, r)
}
Expand Down

0 comments on commit 3aa3861

Please sign in to comment.