(controller)
| 75 | const body = buildBody(parts) |
| 76 | const stream = new ReadableStream<Uint8Array>({ |
| 77 | start(controller) { |
| 78 | if (chunkSize) { |
| 79 | for (let i = 0; i < body.length; i += chunkSize) { |
| 80 | controller.enqueue(new Uint8Array(body.subarray(i, i + chunkSize))) |
| 81 | } |
| 82 | } else { |
| 83 | controller.enqueue(new Uint8Array(body)) |
| 84 | } |
| 85 | controller.close() |
| 86 | }, |
| 87 | }) |
| 88 | return { |
| 89 | headers: new Headers({ 'content-type': `multipart/form-data; boundary=${BOUNDARY}` }), |