(req: http.IncomingMessage)
| 731 | } |
| 732 | |
| 733 | function readBody(req: http.IncomingMessage): Promise<string> { |
| 734 | return new Promise((resolve, reject) => { |
| 735 | const chunks: Array<Buffer> = [] |
| 736 | req.on('data', (c: Buffer) => chunks.push(c)) |
| 737 | req.on('end', () => resolve(Buffer.concat(chunks).toString('utf8'))) |
| 738 | req.on('error', reject) |
| 739 | }) |
| 740 | } |
| 741 | |
| 742 | function drainBody(req: http.IncomingMessage): Promise<void> { |
| 743 | return new Promise((resolve, reject) => { |
no test coverage detected