Closed saraogi closed 12 years ago
Would you please create a failing test case that you would expect to pass?
I've created a pull request to fix this specific bug, with a test!
I'm still running into this issue. We keep an array of supported market locale codes, which are formatted like xx_YY, and passing these to Rack::Accept::Request.best_language returns nil. I have to map(&:downcase) first for it to work?
That's tested against the latest version from master:
>> Rack::Accept::Request.new({'HTTP_ACCEPT_LANGUAGE' => 'en_GB'}).best_language(['en_GB'])
==> nil
>> Rack::Accept::Request.new({'HTTP_ACCEPT_LANGUAGE' => 'en_GB'}).best_language(['en_gb'])
=> "en_gb"
Any ideas?
Merged this pull request earlier today. Thanks @remiprev!
Great, thanks! Love this gem.
Thanks!
Section 3.10 of RFC 2616 states that "all tags are case-insensitive". However, the comparisons here seem to depend upon case. The methods "sort", "best_of", etc make case-sensitive search.