Opened 8 years ago
Closed 8 years ago
#26746 closed Bug (fixed)
Accept-Language header parsing incorrectly transforms q=0 into q=1
Reported by: | Vytis Banaitis | Owned by: | Vytis Banaitis |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Given an Accept-Language header en;q=0
, parse_accept_lang_header
returns [('en', 1.0)]
, which makes en
the most preferable language in this case.
According to RFC 7231, this should not happen.
Also interesting that we have a test for this behavior.
Change History (3)
comment:1 by , 8 years ago
Component: | Utilities → Internationalization |
---|---|
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
The fallback to "1.0" is present since the
Accept-Language
parsing was introduced in 842a771e0527c36a9bcb3984057bb30903e71af3 (tests added in the next commit: a14256aade963929743aa09e0834f5fc4072f772).