[testmode] Fix infinite recursion in testmode passthrough fetch (#96525)
With `experimental.testProxy` on, `@mswjs/interceptors` (switched to socket-level interception in #96059) also catches the passthrough `fetch` that `handleFetch` makes for non-test requests. That request has no `next-test-internal` marker, so the interceptor calls `handleFetch` again, takes the passthrough branch again, and loops until it errors. So any server-side request made outside a test context never resolves during a test run. This adds the `next-test-internal` marker to the passthrough request, and to the `continue` case that has the same problem. It is the guard #96059 already added for the proxy-protocol request, so the request reaches the real server instead of being intercepted again.
Showing
Please
register
or
sign in
to comment