-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undici parses FormData bodies incorrectly #2890
Comments
I am supporting it follows by spec. Only concern is that if it buffered the whole content to memory, what will happen if it exhausted the memory? Can |
The same thing that happens currently, it'll crash. The body is parsed asynchronously but then buffered in memory right now. I don't think undici needs to provide a way of efficiently parsing multipart/form-data bodies, busboy and alternatives do that already. |
Found it.. Firefox - https://github.com/mozilla/gecko-dev/blob/7f3ff3f4d34e7d234da4f5f5b345d2add7f30e95/dom/base/BodyUtil.cpp#L67 |
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.
If someone wants to stream the formdata parsing:
The text was updated successfully, but these errors were encountered: