-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[multipart/form-data] Payload is parsed incorrectly #4462
Comments
This needs more context to properly diagnose, but it seems like you expect one or more part names to be parsed as a query param field? Hapi does not support this, and you will need to rework your request, or maybe add a How did you source this form input? |
@kanongil thanks for your quick response, I sent a form-data request, I expected to have a nested object and array in I expect the request.payload looks like a nested objecte
But It's not, it's a flat object like this
Let me try transforming with the |
I'm not aware of any standards that would expect hapi to parse form-data names as query string object keys, as you seem to suggest. I would strongly suggest that you change your approach, if possible, as this kind of parsing is prone to create security issues, as seen in the related qs module. |
hapi used to use the qs module for parsing complex field names like that, but it was discontinued back in v12. I believe the upgrade path in the release notes from back then is still fairly accurate: #2985 |
Context
How can we help?
I'm working with the multipart/form-data on hapi (version 20.3.0), the request payload is not parsed correctly for array and nested object.
Here is my request payload that i got
My route
The text was updated successfully, but these errors were encountered: