( res: Response, record: RecordConfig | undefined, )
| 184 | * fallback) without retaining anything oversized in memory. |
| 185 | */ |
| 186 | export async function readEnvelopeText( |
| 187 | res: Response, |
| 188 | record: RecordConfig | undefined, |
| 189 | ): Promise<string> { |
| 190 | const read = await readBodyIdle(res, record, VIDEO_PROXY_ENVELOPE_BODY_CAP); |
| 191 | if (read.overCap) { |
| 192 | throw new Error( |
| 193 | `Upstream envelope body exceeded ${VIDEO_PROXY_ENVELOPE_BODY_CAP} bytes (read aborted at ${read.bytesRead})`, |
| 194 | ); |
| 195 | } |
| 196 | return read.buf.toString("utf8"); |
| 197 | } |
no test coverage detected
searching dependent graphs…