(res, message, errorBody)
| 294 | } |
| 295 | |
| 296 | function writeProxyError(res, message, errorBody) { |
| 297 | if (res.destroyed) return; |
| 298 | if (!res.headersSent) { |
| 299 | const { contentType, body } = errorBody(message); |
| 300 | res.writeHead(502, { "Content-Type": contentType }); |
| 301 | res.end(body); |
| 302 | return; |
| 303 | } |
| 304 | res.destroy(); |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * @param {object} [options] |
no outgoing calls
no test coverage detected