fix(proxy): downgrade forwarded requests to HTTP/1.1#455
Conversation
Over TLS the proxy negotiates HTTP/2 inbound via ALPN, but the upstream forward client connects to daemons over cleartext and the dev servers it targets speak HTTP/1.1. The request was forwarded still tagged HTTP/2, so the client attempted h2 to the backend and failed with UserUnsupportedVersion, surfacing as a 502 — every HTTP/1.1 backend (e.g. a Vite dev server) was unreachable through the HTTPS proxy. Normalize the request version to HTTP/1.1 before forwarding.
Greptile SummarySets the forwarded request's HTTP version to
Confidence Score: 5/5Safe to merge — the change is a single targeted line that corrects a version mismatch between inbound HTTP/2 connections and the cleartext HTTP/1.1 upstream client. The fix is minimal and precisely scoped: one assignment corrects the protocol version before the request is forwarded. The forward URI already uses the http scheme (cleartext), confirming the upstream client was never capable of HTTP/2. WebSocket upgrade and pseudo-header stripping paths are unaffected. No logic is rearranged and no new code paths are introduced. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(proxy): downgrade forwarded requests..." | Re-trigger Greptile |
Over TLS the proxy advertises
h2via ALPN (added in v2.10.0), so browsers connect with HTTP/2.proxy_handlerstrips the HTTP/2 pseudo-headers but forwards the request still taggedHTTP/2to the upstream forward client, which connects to daemons over cleartext and is not HTTP/2-capable. The client rejects it withUserUnsupportedVersion, so every HTTP/1.1 backend (e.g. a Vite dev server) returns 502 through the HTTPS proxy.Normalize the forwarded request to HTTP/1.1 before sending it upstream.
Repro with
proxy.https = true:curl https://<slug>.localhost/→ 502curl --http1.1 https://<slug>.localhost/→ 200This PR was created with Claude Code.