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 Tim Graham, 8 years ago

Component: UtilitiesInternationalization
Triage Stage: UnreviewedAccepted

The fallback to "1.0" is present since the Accept-Language parsing was introduced in 842a771e0527c36a9bcb3984057bb30903e71af3 (tests added in the next commit: a14256aade963929743aa09e0834f5fc4072f772).

comment:2 by Vytis Banaitis, 8 years ago

Has patch: set
Owner: changed from nobody to Vytis Banaitis
Status: newassigned

comment:3 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 57eb17b:

Fixed #26746 -- Fixed handling of zero priority in Accept-Language header parsing.

Note: See TracTickets for help on using tickets.
Back to Top