diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2011-02-13 02:37:52 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2011-02-13 02:37:52 +0000 |
| commit | af03867f008fee71112e49ef92e3209eefd2a8ae (patch) | |
| tree | 20e569bcf86cebc7dd52c8fb345c22f458a87053 /tests | |
| parent | 4bcc5012b1642f01efc96f467a549943e3647cf5 (diff) | |
[1.2.X] Fixed #13007 -- Made cookie parsing resilent to the presence of cookies with invalid characters in their names. Thanks Warlax for the report, Ubercore for his work on a fix and Jannis and Luke for review and guidance.
Backport of [15523] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15524 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/httpwrappers/tests.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py index 4e946a2f10..336d9a2817 100644 --- a/tests/regressiontests/httpwrappers/tests.py +++ b/tests/regressiontests/httpwrappers/tests.py @@ -2,7 +2,8 @@ import copy import pickle import unittest -from django.http import QueryDict, HttpResponse, CompatCookie, BadHeaderError +from django.http import (QueryDict, HttpResponse, CompatCookie, BadHeaderError, + parse_cookie) class QueryDictTests(unittest.TestCase): @@ -264,3 +265,9 @@ class CookieTests(unittest.TestCase): c2 = CompatCookie() c2.load(c.output()) self.assertEqual(c['test'].value, c2['test'].value) + + def test_nonstandard_keys(self): + """ + Test that a single non-standard cookie name doesn't affect all cookies. Ticket #13007. + """ + self.assertTrue('good_cookie' in parse_cookie('good_cookie=yes;bad:cookie=yes').keys()) |
