(res: IncomingMessage)
| 2 | import { AppError } from '../kernel/errors.ts'; |
| 3 | |
| 4 | export function readNodeHttpResponseBody(res: IncomingMessage): Promise<string> { |
| 5 | return new Promise((resolve, reject) => { |
| 6 | let body = ''; |
| 7 | res.setEncoding('utf8'); |
| 8 | res.on('data', (chunk) => { |
| 9 | body += chunk; |
| 10 | }); |
| 11 | res.on('end', () => resolve(body)); |
| 12 | res.on('error', reject); |
| 13 | }); |
| 14 | } |
| 15 | |
| 16 | export async function readNodeHttpRequestBody( |
| 17 | req: IncomingMessage, |
no test coverage detected