From: Benjamin Peterson Date: Sat, 17 Jan 2015 01:43:55 +0000 (-0500) Subject: capitialize "HttpOnly" and "Secure" as they appear in the standard and other impls... X-Git-Tag: v3.4.3rc1~118 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd341629b0435a524f9f355de178af22cc6d31ea;p=thirdparty%2FPython%2Fcpython.git capitialize "HttpOnly" and "Secure" as they appear in the standard and other impls (closes #23250) Patch by Jon Dufresne. --- diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py index a6de6d588325..3e1abd7ecf3d 100644 --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -330,8 +330,8 @@ class Morsel(dict): "comment" : "Comment", "domain" : "Domain", "max-age" : "Max-Age", - "secure" : "secure", - "httponly" : "httponly", + "secure" : "Secure", + "httponly" : "HttpOnly", "version" : "Version", } diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index 2b0281edb4ca..e9842526f03e 100644 --- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -114,7 +114,7 @@ class CookieTests(unittest.TestCase): C['Customer']['secure'] = True C['Customer']['httponly'] = True self.assertEqual(C.output(), - 'Set-Cookie: Customer="WILE_E_COYOTE"; httponly; secure') + 'Set-Cookie: Customer="WILE_E_COYOTE"; HttpOnly; Secure') def test_secure_httponly_false_if_not_present(self): C = cookies.SimpleCookie() @@ -152,7 +152,7 @@ class CookieTests(unittest.TestCase): C = cookies.SimpleCookie() C.load('eggs = scrambled ; secure ; path = bar ; foo=foo ') self.assertEqual(C.output(), - 'Set-Cookie: eggs=scrambled; Path=bar; secure\r\nSet-Cookie: foo=foo') + 'Set-Cookie: eggs=scrambled; Path=bar; Secure\r\nSet-Cookie: foo=foo') def test_quoted_meta(self): # Try cookie with quoted meta-data diff --git a/Misc/NEWS b/Misc/NEWS index 412726974116..e4912f640d49 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -44,6 +44,9 @@ Core and Builtins Library ------- +- Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" + as they are written in the standard. + - Issue #23063: In the disutils' check command, fix parsing of reST with code or code-block directives.