(err: any)
| 58 | |
| 59 | proxy.on('proxyRes', (proxyRes, innerReq, innerRes) => { |
| 60 | const cleanup = (err: any) => { |
| 61 | // cleanup event listeners to allow clean garbage collection |
| 62 | proxyRes.removeListener('error', cleanup) |
| 63 | proxyRes.removeListener('close', cleanup) |
| 64 | innerRes.removeListener('error', cleanup) |
| 65 | innerRes.removeListener('close', cleanup) |
| 66 | |
| 67 | // destroy all source streams to propagate the caught event backward |
| 68 | innerReq.destroy(err) |
| 69 | proxyRes.destroy(err) |
| 70 | } |
| 71 | |
| 72 | proxyRes.once('error', cleanup) |
| 73 | proxyRes.once('close', cleanup) |
nothing calls this directly
no test coverage detected