-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Map multipart/form-data
as form
Content-Type
#43017
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
Conversation
I couldn't find many tests If there's any other test that I've missed, please let me know and I'll update it accordingly. |
The failing test seems unrelated to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks correct, but I'm unsure about the target.
- If we file this as a bugfix, we should target 4.4
- If we file this as an improvement, we should target 5.4
We're trying to be on the more cautious side to judge whether something is a bug or a feature since some time. So I would say this "bug fixing feature" should target 5.4. |
As per RFC 2045 and RFC 2388, the `multipart/form-data` Content-Type should be used when submitting a mixed form containing files, binary data and non-ASCII data. This commit helps with infrastructure that is directly checking against the `Request::getContentType()` method in scenarios, where a mixed form has been submitted. Resolves symfony#34240
db4d779
to
e597655
Compare
@wouterj I've rebased the PR to 5.4 as requested. Thanks for the feedback to both of you |
Thank you @keichinger. |
As per RFC 2045 and RFC 2388 (see https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2), the
multipart/form-data
Content-Type should be used when submitting a mixed forms containing files, binary data and non-ASCII data.Currently, the same logic that would run in regular, non-mixed form scenarios can't run for mixed forms, as soon as it relies on the result of
Request::getContentType()
or anything else that might rely onRequest::$formats
without going low-level and avoiding the implemented abstraction. This PR fixes that.Resolves #34240