Negotiation icon indicating copy to clipboard operation
Negotiation copied to clipboard

Support */* for EncodingNegotiator

Open TiMESPLiNTER opened this issue 5 years ago • 1 comments

Currently passing in an accept header equals */* does not work. It tells that there's no match and EncodingNegotiator::getBest() returns null instead it should return the highest prioritized available content type.

$negotiator = new EncodingNegotiator();
$mediaType = $negotiator->getBest('*/*', ['application/json']);
var_dump($mediaType); // -> null, but should be 'application/json'

TiMESPLiNTER avatar Apr 06 '20 16:04 TiMESPLiNTER

Hey, could you please write a test case and submit a PR to start a conversation around this issue? Thanks!

willdurand avatar Jan 30 '22 20:01 willdurand