allow error responses when proxying
All checks were successful
Build and Publish / Metadata (push) Successful in 12s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m17s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m32s

This commit is contained in:
2025-10-23 18:24:45 +02:00
parent d9fb49ec0b
commit b7ae36e53c

View File

@@ -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") w.Header().Set("X-Cart-Owner-Routed", "true")
if res.StatusCode >= 200 && res.StatusCode <= 299 {
w.WriteHeader(res.StatusCode) w.WriteHeader(res.StatusCode)
_, copyErr := io.Copy(w, res.Body) _, copyErr := io.Copy(w, res.Body)
if copyErr != nil { if copyErr != nil {
return true, copyErr return true, copyErr
}
return true, nil
} }
return false, fmt.Errorf("proxy response status %d", res.StatusCode) return true, nil
} }
func (r *RemoteHost) IsHealthy() bool { func (r *RemoteHost) IsHealthy() bool {