(res, message)
| 194 | } |
| 195 | |
| 196 | function writeProxyError(res, message) { |
| 197 | if (res.destroyed) return; |
| 198 | if (!res.headersSent) { |
| 199 | res.writeHead(502, { "Content-Type": "text/plain; charset=utf-8" }); |
| 200 | res.end(`Bad Gateway: ${message}`); |
| 201 | return; |
| 202 | } |
| 203 | res.destroy(); |
| 204 | } |
| 205 | |
| 206 | export function createProxyHandlers({ |
| 207 | label = "proxy", |
no outgoing calls
no test coverage detected