#16322 closed Bug (fixed)
Some mobile Accept-Language headers are not parsed
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Internationalization | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Some mobile phones use spaces before or after semicolon in Accept-Language header. Django can't parse such headers:
"Accept-Language: en; q=1.0, *; q=0.5" "Accept-Language: ru-ru,*; q=0.5"
>>> parse_accept_lang_header('en; q=1.0, *; q=0.5') >>> []
More examples here: http://stackoverflow.com/questions/377864/detect-mobile-supported-languages
Another confirmation: https://www-304.ibm.com/support/docview.wss?uid=swg1PK98260&wv=1
According to RFC 2616, there should be no whitespaces, but RFC 3282 allows CFWS and also I found this proposal http://lists.w3.org/Archives/Public/ietf-http-wg/2009OctDec/0177.html where OWS is explicitly mentioned.
Attachments (1)
Change History (5)
comment:1 by , 14 years ago
Easy pickings: | set |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
by , 14 years ago
Attachment: | allow-spaces-in-accept-language.diff added |
---|
comment:2 by , 13 years ago
Has patch: | set |
---|---|
Needs tests: | unset |
Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
patch with tests