Call WriteHeader after setting other header(s) in the example (#442)

From the docs: Changing the header map after a call to WriteHeader (or
Write) has no effect unless the modified headers are
trailers.
This commit is contained in:
Tim
2019-01-25 11:41:49 +00:00
committed by Matt Silverlock
parent 08e7f807d3
commit 797e653da6

View File

@@ -503,8 +503,8 @@ package main
func HealthCheckHandler(w http.ResponseWriter, r *http.Request) {
// A very simple health check.
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
// In the future we could report back on the status of our DB, or our cache
// (e.g. Redis) by performing a simple PING, and include them in the response.