(res, statusCode, contentType, payload, extraHeaders = {})
| 99 | } |
| 100 | |
| 101 | function writeBuffer(res, statusCode, contentType, payload, extraHeaders = {}) { |
| 102 | res.writeHead(statusCode, { |
| 103 | 'cache-control': 'no-store', |
| 104 | 'content-length': payload.byteLength, |
| 105 | 'content-type': contentType, |
| 106 | ...extraHeaders, |
| 107 | }) |
| 108 | res.end(payload) |
| 109 | } |
| 110 | |
| 111 | function writeHtml(res, statusCode, body, extraHeaders = {}) { |
| 112 | const payload = Buffer.from(body) |
no outgoing calls
no test coverage detected