diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-05-23 15:36:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-05-23 15:36:48 (GMT) |
commit | 9bd476ea57e1f77c5d117577d721bff806137a09 (patch) | |
tree | d52aa4b0cfd0bd7e6245ce676bca25d791fb4dc8 /Lib/test/test_http_cookies.py | |
parent | 0823ffb2fb16aa29cefd4c1b91edd82d9814e46a (diff) | |
download | cpython-9bd476ea57e1f77c5d117577d721bff806137a09.zip cpython-9bd476ea57e1f77c5d117577d721bff806137a09.tar.gz cpython-9bd476ea57e1f77c5d117577d721bff806137a09.tar.bz2 |
allow square brackets in cookie values (closes #22931)
Diffstat (limited to 'Lib/test/test_http_cookies.py')
-rw-r--r-- | Lib/test/test_http_cookies.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index 30d4898..a0edcbf 100644 --- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -34,6 +34,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' + )) + } ] for case in cases: |