diff options
author | Jacob Neil Taylor <me@jacobtaylor.id.au> | 2020-10-23 22:48:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-23 22:48:55 (GMT) |
commit | 16ee68da6e12bb2d79751b32cc37523fe4f4bb48 (patch) | |
tree | dd97261b83ce7b3d0b33ae6835efe1f0124a5a22 /Lib/test/test_http_cookiejar.py | |
parent | a3c4ceffe61df89cc9ce5c437cae0276521dc83b (diff) | |
download | cpython-16ee68da6e12bb2d79751b32cc37523fe4f4bb48.zip cpython-16ee68da6e12bb2d79751b32cc37523fe4f4bb48.tar.gz cpython-16ee68da6e12bb2d79751b32cc37523fe4f4bb48.tar.bz2 |
bpo-38976: Add support for HTTP Only flag in MozillaCookieJar (#17471)
Add support for HTTP Only flag in MozillaCookieJar
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_http_cookiejar.py')
-rw-r--r-- | Lib/test/test_http_cookiejar.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 99d038f..fdf15ef 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -1773,6 +1773,10 @@ class LWPCookieTests(unittest.TestCase): interact_netscape(c, "http://www.foo.com/", "fooc=bar; Domain=www.foo.com; %s" % expires) + for cookie in c: + if cookie.name == "foo1": + cookie.set_nonstandard_attr("HTTPOnly", "") + def save_and_restore(cj, ignore_discard): try: cj.save(ignore_discard=ignore_discard) @@ -1787,6 +1791,7 @@ class LWPCookieTests(unittest.TestCase): new_c = save_and_restore(c, True) self.assertEqual(len(new_c), 6) # none discarded self.assertIn("name='foo1', value='bar'", repr(new_c)) + self.assertIn("rest={'HTTPOnly': ''}", repr(new_c)) new_c = save_and_restore(c, False) self.assertEqual(len(new_c), 4) # 2 of them discarded on save |