(res, message)
| 45 | } |
| 46 | |
| 47 | function writeProxyError(res, message) { |
| 48 | if (res.destroyed) return; |
| 49 | if (!res.headersSent) { |
| 50 | res.writeHead(502, { "Content-Type": "text/plain; charset=utf-8" }); |
| 51 | res.end(`Bad Gateway: ${message}`); |
| 52 | return; |
| 53 | } |
| 54 | res.destroy(); |
| 55 | } |
| 56 | |
| 57 | export function createProxyHandlers({ |
| 58 | label = "proxy", |
no outgoing calls
no test coverage detected