(res, message, errorBody)
| 262 | } |
| 263 | |
| 264 | function writeProxyError(res, message, errorBody) { |
| 265 | if (res.destroyed) return; |
| 266 | if (!res.headersSent) { |
| 267 | const { contentType, body } = errorBody(message); |
| 268 | res.writeHead(502, { "Content-Type": contentType }); |
| 269 | res.end(body); |
| 270 | return; |
| 271 | } |
| 272 | res.destroy(); |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * @param {object} [options] |
no outgoing calls
no test coverage detected