| 2432 | const responseControllers = new WeakMap<HttpClientResponse.HttpClientResponse, AbortController>() |
| 2433 | |
| 2434 | const trackResponse = ( |
| 2435 | response: HttpClientResponse.HttpClientResponse, |
| 2436 | controller: AbortController, |
| 2437 | scoped: boolean, |
| 2438 | urlParamsRedactedNames: ReadonlyArray<string | RegExp>, |
| 2439 | redactedPath: ClientPath | undefined |
| 2440 | ): HttpClientResponse.HttpClientResponse => { |
| 2441 | // Body readers create errors with the runner's response, while callers hold |
| 2442 | // the wrapper, so both carry the names of the executing fiber. |
| 2443 | Error.addResponseRedactedNames(response, urlParamsRedactedNames, redactedPath) |
| 2444 | if (!scoped) { |
| 2445 | responseRegistry.register(response, controller) |
| 2446 | response = new InterruptibleResponse(response, controller) |
| 2447 | Error.addResponseRedactedNames(response, urlParamsRedactedNames, redactedPath) |
| 2448 | } |
| 2449 | responseControllers.set(response, controller) |
| 2450 | return response |
| 2451 | } |
| 2452 | |
| 2453 | class InterruptibleResponse implements HttpClientResponse.HttpClientResponse, Pipeable { |
| 2454 | readonly original: HttpClientResponse.HttpClientResponse |