From b7ae36e53cc920bca729740619a183ec39943501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20T=C3=B6rnberg?= Date: Thu, 23 Oct 2025 18:24:45 +0200 Subject: [PATCH] allow error responses when proxying --- pkg/proxy/remotehost.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/proxy/remotehost.go b/pkg/proxy/remotehost.go index a931dd5..5367046 100644 --- a/pkg/proxy/remotehost.go +++ b/pkg/proxy/remotehost.go @@ -171,15 +171,14 @@ func (h *RemoteHost) Proxy(id uint64, w http.ResponseWriter, r *http.Request) (b } } w.Header().Set("X-Cart-Owner-Routed", "true") - if res.StatusCode >= 200 && res.StatusCode <= 299 { - w.WriteHeader(res.StatusCode) - _, copyErr := io.Copy(w, res.Body) - if copyErr != nil { - return true, copyErr - } - return true, nil + + w.WriteHeader(res.StatusCode) + _, copyErr := io.Copy(w, res.Body) + if copyErr != nil { + return true, copyErr } - return false, fmt.Errorf("proxy response status %d", res.StatusCode) + return true, nil + } func (r *RemoteHost) IsHealthy() bool {