mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
3782922bdd
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.