cpython: d22fadc18d01 (original) (raw)

Mercurial > cpython

changeset 102301:d22fadc18d01 3.2

#22758: fix regression in handling of secure cookies. This backports the fix from #16611, per discussion with the release manager. [#22758]

R David Murray rdmurray@bitdance.com
date Sun, 10 Jul 2016 13:32:43 -0400
parents b2036b717028
children 1c07bd735282 a0bf31e50da5
files Lib/http/cookies.py Lib/test/test_http_cookies.py Misc/NEWS
diffstat 3 files changed, 61 insertions(+), 11 deletions(-)[+] [-] Lib/http/cookies.py 29 Lib/test/test_http_cookies.py 40 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -338,6 +338,8 @@ class Morsel(dict): "version" : "Version", }

+ def init(self): # Set defaults self.key = self.value = self.coded_value = None @@ -437,15 +439,18 @@ class Morsel(dict): (?P # Start of group 'key' [""" + _LegalKeyChars + r"""]+? # Any word of at least one letter ) # End of group 'key'

--- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -114,13 +114,51 @@ class CookieTests(unittest.TestCase): self.assertEqual(C.output(), 'Set-Cookie: Customer="WILE_E_COYOTE"; Max-Age=10')

+

+

+

+

+ def test_quoted_meta(self): # Try cookie with quoted meta-data C = cookies.SimpleCookie()

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -28,6 +28,9 @@ Tests self-signed.pythontest.net. This avoids relying on svn.python.org, which recently changed root certificate. +- Issue #22758: Fix a regression that no longer allowed secure and httponly