| 1279 | |
| 1280 | describe('size limits', () => { |
| 1281 | const makeUploadStream = (totalBytes, chunkSize = 512) => { |
| 1282 | let remaining = totalBytes; |
| 1283 | |
| 1284 | return new ReadableStream({ |
| 1285 | pull(controller) { |
| 1286 | if (remaining <= 0) { |
| 1287 | controller.close(); |
| 1288 | return; |
| 1289 | } |
| 1290 | |
| 1291 | const size = Math.min(chunkSize, remaining); |
| 1292 | remaining -= size; |
| 1293 | controller.enqueue(new Uint8Array(size)); |
| 1294 | }, |
| 1295 | }); |
| 1296 | }; |
| 1297 | |
| 1298 | it('should reject an outbound body that exceeds maxBodyLength with ERR_BAD_REQUEST', async () => { |
| 1299 | const server = await startHTTPServer( |