File tree 2 files changed +4
-1
lines changed
src/Symfony/Component/HttpFoundation
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1326,7 +1326,7 @@ public function getFormat($mimeType)
1326
1326
{
1327
1327
$ canonicalMimeType = null ;
1328
1328
if (false !== $ pos = strpos ($ mimeType , '; ' )) {
1329
- $ canonicalMimeType = substr ($ mimeType , 0 , $ pos );
1329
+ $ canonicalMimeType = trim ( substr ($ mimeType , 0 , $ pos) );
1330
1330
}
1331
1331
1332
1332
if (null === static ::$ formats ) {
Original file line number Diff line number Diff line change @@ -323,6 +323,9 @@ public function testGetFormatFromMimeTypeWithParameters()
323
323
{
324
324
$ request = new Request ();
325
325
$ this ->assertEquals ('json ' , $ request ->getFormat ('application/json; charset=utf-8 ' ));
326
+ $ this ->assertEquals ('json ' , $ request ->getFormat ('application/json;charset=utf-8 ' ));
327
+ $ this ->assertEquals ('json ' , $ request ->getFormat ('application/json ; charset=utf-8 ' ));
328
+ $ this ->assertEquals ('json ' , $ request ->getFormat ('application/json ;charset=utf-8 ' ));
326
329
}
327
330
328
331
public function testGetFormatWithCustomMimeType ()
You can’t perform that action at this time.
0 commit comments