test: forward keep-alive requests in proxy.test.ts's mock proxy (#31352)
The mock proxy fixture in `test/js/bun/http/proxy.test.ts` only serviced
the first request on each client connection when proxying plain-HTTP
origins (its non-CONNECT branch used a single `once("data")` forward
with no persistent client-to-upstream path). fetch correctly reuses the
keep-alive proxy connection after a 302, so the second absolute-form
request was never read and the three "proxy can handle redirects with
non-TLS server" tests timed out on every build.
This restructures the fixture's absolute-form branch to forward every
request that arrives on the persistent proxy connection, rewriting each
absolute-form request line to origin form and reconnecting the upstream
when the destination changes. The CONNECT branch is unchanged. Adds a
test that drives a 3-hop redirect chain against a plain-HTTP origin
through a dedicated HTTPS proxy and asserts the proxy observes each hop
as its own forwarded request.
The three previously timing-out tests now pass; the rest of the file is
unaffected (the one remaining failure in the file, `non-200 CONNECT
response from proxy is surfaced...`, fails identically before and after
this change and does not use this fixture). J
Jarred Sumner committed
705c482b692b24e22455b6d83015b0a4323b502d
Parent: 1c6597b
Committed by GitHub <noreply@github.com>
on 5/25/2026, 4:45:42 AM