Open brianjmiller opened 8 years ago
I'm having this issue with the Accept
request HTTP header.
My given accepted content types:
[ 'application/json', 'text/html', 'application/xhtml+xml', 'application/xml' ]
MSIE11
text/html, application/xhtml+xml, */*
application/json
Chrome
text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8
text/html
(the correct content type to respond)The solution I used is similar to yours, I forced a lower priority on the wildcard:
preg_replace('/(\*\/\*)(?!;q=)/i', '$1;q=0.8', getenv('HTTP_ACCEPT'));
Given a list of languages like:
['en-US' => '...', 'en-UK' => '....']
And a language string of:
en-US, *
I get the value for
en-UK
usinggetBest
and based on my (admittedly new) reading of the RFC suggests that I should get the 'en-US' value since it is listed first and they have the same quality factor. (Common sense suggests that is the better value.)Switching the accept string to be
en-US, *;q=0
resolves the matter but seems either incorrect or at least unnecessary.Am I doing something wrong or is this a bug? It looked similar to some of the other open issues, but not quite the same. It also wasn't a problem in the 1.x release series.