File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1515use Symfony \Component \HttpFoundation \RequestMatcherInterface ;
1616
1717use Negotiation \FormatNegotiator as BaseFormatNegotiator ;
18+ use Negotiation \AcceptHeader ;
1819
1920class FormatNegotiator implements MediaTypeNegotiatorInterface
2021{
@@ -96,7 +97,7 @@ public function getBestMediaType(Request $request)
9697
9798 $ mimeTypes = $ this ->formatNegotiator ->normalizePriorities ($ options ['priorities ' ]);
9899 $ mediaType = $ this ->formatNegotiator ->getBest ($ acceptHeader , $ mimeTypes );
99- if (null !== $ mediaType ) {
100+ if (! $ mediaType instanceof AcceptHeader || ! $ mediaType-> isMediaRange () ) {
100101 return $ mediaType ->getValue ();
101102 }
102103
Original file line number Diff line number Diff line change 2525 "php" : " >=5.3.2" ,
2626 "symfony/framework-bundle" : " ~2.2" ,
2727 "doctrine/inflector" : " 1.0.*" ,
28- "willdurand/negotiation" : " ~1.1 .0"
28+ "willdurand/negotiation" : " ~1.2 .0"
2929 },
3030
3131 "require-dev" : {
You can’t perform that action at this time.
0 commit comments