summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorAda <ada@gnous.eu>2024-04-05 18:20:04 +0200
committerAda <ada@gnous.eu>2024-04-05 18:44:17 +0200
commitb210a3ebd59ffd59a82bbddcf9b9cee3fee43598 (patch)
treebd3a25a20063815d1df8a61fa23d170cd0fd3c20 /routers
parentMerge pull request 'Update dependency @stoplight/spectral-cli to v6.11.1' (#3... (diff)
downloadforgejo-b210a3ebd59ffd59a82bbddcf9b9cee3fee43598.tar.xz
forgejo-b210a3ebd59ffd59a82bbddcf9b9cee3fee43598.zip
Fix #3030 add Cache-Control header for health-check
Diffstat (limited to 'routers')
-rw-r--r--routers/web/healthcheck/check.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/web/healthcheck/check.go b/routers/web/healthcheck/check.go
index d278ee1709..6be3be86d8 100644
--- a/routers/web/healthcheck/check.go
+++ b/routers/web/healthcheck/check.go
@@ -85,6 +85,7 @@ func Check(w http.ResponseWriter, r *http.Request) {
data, _ := json.MarshalIndent(rsp, "", " ")
w.Header().Set("Content-Type", "application/json")
+ w.Header().Set("Cache-Control", "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate")
w.WriteHeader(rsp.Status.ToHTTPStatus())
_, _ = w.Write(data)
}