(statusCode: number, headers: Record<string, string>, body = '')
| 26 | ] |
| 27 | |
| 28 | function createResponse(statusCode: number, headers: Record<string, string>, body = '') { |
| 29 | const response = Readable.from(body.length > 0 ? [body] : []) |
| 30 | return Object.assign(response, { |
| 31 | statusCode, |
| 32 | headers, |
| 33 | }) |
| 34 | } |
| 35 | |
| 36 | function createConnectRequest({ |
| 37 | statusCode = 200, |