summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-06-25 16:18:40 +0000
committerRamiro Morales <cramm0@gmail.com>2011-06-25 16:18:40 +0000
commitc159374a33caee14d9903de58a9f4fe879e5741c (patch)
tree3c2e75ad8babab2440e1ac70d37ec08453dcd32c /django/http
parent25c5251acd79293c8cbaef393ceb1db388262190 (diff)
Fixed #15852 -- Modified cookie parsing so it can handle duplicate invalid cookie names. Thanks goes to Fredrik Stålnacke for the report and to vung for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16452 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
-rw-r--r--django/http/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 2a88ee1950..cf1eb0d9e2 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -91,7 +91,7 @@ else:
if not _cookie_allows_colon_in_names:
def load(self, rawdata, ignore_parse_errors=False):
if ignore_parse_errors:
- self.bad_cookies = []
+ self.bad_cookies = set()
self._BaseCookie__set = self._loose_set
super(SimpleCookie, self).load(rawdata)
if ignore_parse_errors:
@@ -105,8 +105,8 @@ else:
try:
self._strict_set(key, real_value, coded_value)
except Cookie.CookieError:
- self.bad_cookies.append(key)
- dict.__setitem__(self, key, None)
+ self.bad_cookies.add(key)
+ dict.__setitem__(self, key, Cookie.Morsel())
class CompatCookie(SimpleCookie):