Loading django/http/__init__.py +8 −3 Original line number Diff line number Diff line import os from Cookie import SimpleCookie from Cookie import SimpleCookie, CookieError from pprint import pformat from urllib import urlencode from urlparse import urljoin Loading Loading @@ -239,8 +239,13 @@ class QueryDict(MultiValueDict): def parse_cookie(cookie): if cookie == '': return {} try: c = SimpleCookie() c.load(cookie) except CookieError: # Invalid cookie return {} cookiedict = {} for key in c.keys(): cookiedict[key] = c.get(key).value Loading tests/regressiontests/requests/tests.py +4 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,8 @@ GET:{}, POST:{}, COOKIES:{}, META:{}> >>> from django.http import parse_cookie >>> parse_cookie('invalid:key=true') {} """ Loading
django/http/__init__.py +8 −3 Original line number Diff line number Diff line import os from Cookie import SimpleCookie from Cookie import SimpleCookie, CookieError from pprint import pformat from urllib import urlencode from urlparse import urljoin Loading Loading @@ -239,8 +239,13 @@ class QueryDict(MultiValueDict): def parse_cookie(cookie): if cookie == '': return {} try: c = SimpleCookie() c.load(cookie) except CookieError: # Invalid cookie return {} cookiedict = {} for key in c.keys(): cookiedict[key] = c.get(key).value Loading
tests/regressiontests/requests/tests.py +4 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,8 @@ GET:{}, POST:{}, COOKIES:{}, META:{}> >>> from django.http import parse_cookie >>> parse_cookie('invalid:key=true') {} """