diff options
| author | R. David Murray <rdmurray@bitdance.com> | 2010-12-28 18:56:33 (GMT) |
|---|---|---|
| committer | R. David Murray <rdmurray@bitdance.com> | 2010-12-28 18:56:33 (GMT) |
| commit | daa7ba038b9556ff0adabb2ab10c092c73b20243 (patch) | |
| tree | e8126330fd2af01df0d7b81aca41e9c41052429d /Lib/test | |
| parent | 6c85838489d4627d0f8292c3a3aead3519d4765c (diff) | |
| download | cpython-daa7ba038b9556ff0adabb2ab10c092c73b20243.zip cpython-daa7ba038b9556ff0adabb2ab10c092c73b20243.tar.gz cpython-daa7ba038b9556ff0adabb2ab10c092c73b20243.tar.bz2 | |
Merged revisions 87550 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r87550 | r.david.murray | 2010-12-28 13:54:13 -0500 (Tue, 28 Dec 2010) | 8 lines
#9824: encode , and ; in cookie values so that browsers don't split on them
There is a small chance of backward incompatibility here, but only for
non-SimpleCookie applications reading SimpleCookie generated cookies. Even
then, any such ap is likely to be handling escaped values already, and it would
take a fairly perverse implementation of unescaping to fail to unescape these
newly escaped chars, so the risk seems minimal.
........
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_http_cookies.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index 99133f7..cc225cd 100644 --- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -65,6 +65,14 @@ class CookieTests(unittest.TestCase): </script> """) + def test_extended_encode(self): + # Issue 9824: some browsers don't follow the standard; we now + # encode , and ; to keep them from tripping up. + C = cookies.SimpleCookie() + C['val'] = "some,funky;stuff" + self.assertEqual(C.output(['val']), + 'Set-Cookie: val="some\\054funky\\073stuff"') + def test_special_attrs(self): # 'expires' C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
