diff options
| author | Benjamin Peterson <benjamin@python.org> | 2015-05-23 15:46:25 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2015-05-23 15:46:25 (GMT) |
| commit | ec7abfb58fdf8ab6d1af1aba4731bf149a7d485e (patch) | |
| tree | 4c64e6dade983392d0e8a68ec088560d36ab566d /Lib/test/test_cookie.py | |
| parent | a71a4f4ed32e9f1c6b43c7ac660dcc58cb0ce9bc (diff) | |
| download | cpython-ec7abfb58fdf8ab6d1af1aba4731bf149a7d485e.zip cpython-ec7abfb58fdf8ab6d1af1aba4731bf149a7d485e.tar.gz cpython-ec7abfb58fdf8ab6d1af1aba4731bf149a7d485e.tar.bz2 | |
allow square brackets in cookie values (#22931)
Diffstat (limited to 'Lib/test/test_cookie.py')
| -rw-r--r-- | Lib/test/test_cookie.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_cookie.py b/Lib/test/test_cookie.py index 36cd52e..4041901 100644 --- a/Lib/test/test_cookie.py +++ b/Lib/test/test_cookie.py @@ -27,6 +27,20 @@ class CookieTests(unittest.TestCase): 'dict': {'keebler' : 'E=mc2'}, 'repr': "<SimpleCookie: keebler='E=mc2'>", 'output': 'Set-Cookie: keebler=E=mc2', + }, + + # issue22931 - Adding '[' and ']' as valid characters in cookie + # values as defined in RFC 6265 + { + 'data': 'a=b; c=[; d=r; f=h', + 'dict': {'a':'b', 'c':'[', 'd':'r', 'f':'h'}, + 'repr': "<SimpleCookie: a='b' c='[' d='r' f='h'>", + 'output': '\n'.join(( + 'Set-Cookie: a=b', + 'Set-Cookie: c=[', + 'Set-Cookie: d=r', + 'Set-Cookie: f=h' + )) } ] |
