-
-
Notifications
You must be signed in to change notification settings - Fork 674
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The parsing should be synchronous. The spec makes it abundantly clear that you buffer the body in memory and then parse it, which we do for every other body mixin. It also doesn't make much sense for us to parse the body asynchronously only for us to buffer it into memory later on. It's not meant for server environments and we shouldn't give people a false sense of security.
- It's also extremely slow
- We also fail a large amount of WPTs regarding formdata parsing because of this.
- There are a large number of hacks/workarounds for shortcomings of our current approach.
- Every other platform (Deno, Webkit/bun, Chrome, and Firefox) parse it synchronously. I've previously posted proof of this in an issue but it'd be hard to track it down.
If someone wants to stream the formdata parsing:
const response = await fetch('https://formdata.idk.com')
const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } })
Readable.from(response.body).pipe(busboy)mcollinamcollina
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working