mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-15 02:45:22 +00:00
Fix #3030 add Cache-Control header for health-check
(cherry picked from commit b210a3ebd5
)
This commit is contained in:
parent
7e5fed7e29
commit
3eab81fdea
|
@ -85,6 +85,7 @@ func Check(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
data, _ := json.MarshalIndent(rsp, "", " ")
|
data, _ := json.MarshalIndent(rsp, "", " ")
|
||||||
w.Header().Set("Content-Type", "application/json")
|
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.WriteHeader(rsp.Status.ToHTTPStatus())
|
||||||
_, _ = w.Write(data)
|
_, _ = w.Write(data)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue