Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db4d779

Browse filesBrowse files
author
Kai Eichinger
committed
Map multipart/form-data as form Content-Type
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 #34240
1 parent 7d27bff commit db4d779
Copy full SHA for db4d779

File tree

2 files changed

+2
-1
lines changed
Filter options

2 files changed

+2
-1
lines changed

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ protected static function initializeFormats()
19841984
'rdf' => ['application/rdf+xml'],
19851985
'atom' => ['application/atom+xml'],
19861986
'rss' => ['application/rss+xml'],
1987-
'form' => ['application/x-www-form-urlencoded'],
1987+
'form' => ['application/x-www-form-urlencoded', 'multipart/form-data'],
19881988
];
19891989
}
19901990

‎src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ public function getFormatToMimeTypeMapProvider()
501501
['xml', ['text/xml', 'application/xml', 'application/x-xml']],
502502
['rdf', ['application/rdf+xml']],
503503
['atom', ['application/atom+xml']],
504+
['form', ['application/x-www-form-urlencoded', 'multipart/form-data']],
504505
];
505506
}
506507

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.