Skip to content

Commit

Permalink
pkg/receive: return correct status code
Browse files Browse the repository at this point in the history
status code, i.e. it does not overwrite the status code returned by the
downstream handler.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
  • Loading branch information
squat committed Jan 21, 2020
1 parent 7d0245b commit 9562123
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/receive/handler.go
Expand Up @@ -67,7 +67,8 @@ func (h *Handler) Receive(w http.ResponseWriter, r *http.Request) {
if resp.StatusCode/100 != 2 {
msg := "upstream response status is not 200 OK"
level.Error(h.logger).Log("msg", msg, "statuscode", resp.Status)
http.Error(w, msg, http.StatusBadGateway)
http.Error(w, msg, resp.StatusCode)
return
}
w.WriteHeader(resp.StatusCode)
}

0 comments on commit 9562123

Please sign in to comment.