]> granicus.if.org Git - python/commitdiff
capitialize "HttpOnly" and "Secure" as they appear in the standard and other impls...
authorBenjamin Peterson <benjamin@python.org>
Sat, 17 Jan 2015 01:43:55 +0000 (20:43 -0500)
committerBenjamin Peterson <benjamin@python.org>
Sat, 17 Jan 2015 01:43:55 +0000 (20:43 -0500)
Patch by Jon Dufresne.

Lib/http/cookies.py
Lib/test/test_http_cookies.py
Misc/NEWS

index a6de6d588325caa7d6962df02045c87b62024b67..3e1abd7ecf3d2fa2bff2f0930c57ef8ae80a9ad0 100644 (file)
@@ -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",
     }
 
index 2b0281edb4ca36586e3ee69ba9b8a40c45553976..e9842526f03ee494788377a68a737ca0c811b48e 100644 (file)
@@ -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
index 4127269741169726e4ae66fcd09b085efca129ab..e4912f640d4968d59b7fa275b4b3e922e1c556be 100644 (file)
--- 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.