summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-26 16:51:54 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-26 16:51:54 +0000
commit352b7ffaf039b3b7b112dd60a690101ecec70cf2 (patch)
tree9e8a4b6a67d4051c9a8c9ac49a754ce7fd4f063a /django
parent4a1033898636f8c2cafc74c7934fdf7411716fdf (diff)
Fixed #16322 -- Fixed Accept-Language parsing to allow spaces around semicolons. Thanks, Max Arnold.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16457 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/utils/translation/trans_real.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 9f930b54ef..edecfeca61 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -30,9 +30,9 @@ CONTEXT_SEPARATOR = u"\x04"
# Format of Accept-Language header values. From RFC 2616, section 14.4 and 3.9.
accept_language_re = re.compile(r'''
- ([A-Za-z]{1,8}(?:-[A-Za-z]{1,8})*|\*) # "en", "en-au", "x-y-z", "*"
- (?:;q=(0(?:\.\d{,3})?|1(?:.0{,3})?))? # Optional "q=1.00", "q=0.8"
- (?:\s*,\s*|$) # Multiple accepts per header.
+ ([A-Za-z]{1,8}(?:-[A-Za-z]{1,8})*|\*) # "en", "en-au", "x-y-z", "*"
+ (?:\s*;\s*q=(0(?:\.\d{,3})?|1(?:.0{,3})?))? # Optional "q=1.00", "q=0.8"
+ (?:\s*,\s*|$) # Multiple accepts per header.
''', re.VERBOSE)
language_code_prefix_re = re.compile(r'^/([\w-]+)/')