diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c40da47b33..4909b71f35f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ * [BUGFIX] Ring: Fixed a situation where upgrading from pre-1.0 cortex with a rolling strategy caused new 1.0 ingesters to lose their zone value in the ring until manually forced to re-register. #2404 * [BUGFIX] Distributor: `/all_user_stats` now show API and Rule Ingest Rate correctly. #2457 * [BUGFIX] Fixed `version`, `revision` and `branch` labels exported by the `cortex_build_info` metric. #2468 +* [BUGFIX] QueryFrontend: fixed a situation where HTTP error is ignored and an incorrect status code is set. #2483 ## 1.0.0 / 2020-04-02 diff --git a/pkg/querier/frontend/frontend.go b/pkg/querier/frontend/frontend.go index 1306646c568..2ea2083f974 100644 --- a/pkg/querier/frontend/frontend.go +++ b/pkg/querier/frontend/frontend.go @@ -176,7 +176,11 @@ func (f *Frontend) handle(w http.ResponseWriter, r *http.Request) { hs[h] = vs } w.WriteHeader(resp.StatusCode) - io.Copy(w, resp.Body) + + if _, err = io.Copy(w, resp.Body); err != nil { + server.WriteError(w, err) + return + } } func writeError(w http.ResponseWriter, err error) {