Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LanguageAccept.best_match fails matching langs with extras to bare langs #1651

Closed
golyalpha opened this issue Sep 27, 2019 · 2 comments
Closed

Comments

@golyalpha
Copy link

Werkzeug version: 0.16.0

Used through Flask.

In flask:

print("Accept-Language: %s" % (request.accept_languages,))
print("Best match: %s" % (request.accept_languages.best_match(["en"]),))

Comes back with:

Accept-Language: en-gb
Best match: None

When request comes from Safari. UA:

Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1

According to #450, Best match should be en instead.

@davidism
Copy link
Member

It's marked for the 1.0.0 milestone.

@golyalpha

This comment has been minimized.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants