{"version":"2.1.299","anchor":"proxy-returns-502-bad-gateway-on-invalid-upstream-response-h","canonical_anchor":"proxy-returns-502-bad-gateway-on-invalid-upstream-response-h","heading":"Proxy answers with 502 Bad Gateway when a server sends a broken response","tier":"notice","area":"Sandbox","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299\/e\/proxy-returns-502-bad-gateway-on-invalid-upstream-response-h","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299","markdown":"### Proxy answers with 502 Bad Gateway when a server sends a broken response\n\nWhen an upstream server sends an invalid status or headers through Claude Code's proxy, Claude Code now returns 502 Bad Gateway\n\n**What**\n\nA proxy passes requests on to another server, called upstream, and relays the answer back. When the upstream server's answer starts with an invalid status code or headers, Claude Code now logs an error and drops that answer. Then:\n\n- If nothing has been sent back yet, it replies with a 502 \"Bad Gateway\" error.\n\n- If a reply has already started, it closes the connection.\n\n**Why**\n\nA malformed answer from the server now produces a clean 502 error instead of an unhandled failure.\n\n- Area: Sandbox\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}