Enhancement: Normalize non-200 proxy responses to error JSON (#6630)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled

This commit is contained in:
shamoon
2026-05-05 13:30:12 -07:00
committed by GitHub
parent ffb264cead
commit 72b0e493d0
2 changed files with 27 additions and 0 deletions
+8
View File
@@ -158,6 +158,14 @@ export default async function credentialedProxyHandler(req, res, map) {
if (status >= 400) {
logger.error("HTTP Error %d calling %s", status, url.toString());
return res.status(status).json({
error: {
message: resultData?.error?.message ?? "HTTP Error",
url: sanitizeErrorURL(url),
...(resultData?.error?.rawError ? { rawError: resultData.error.rawError } : {}),
data: Buffer.isBuffer(resultData) ? Buffer.from(resultData).toString() : resultData,
},
});
}
if (status === 200) {