Skip to content

Commit eb730a3

Browse files
committed
Change HTTPONLY_ATTR value from "HTTPOnly" to "HttpOnly"
This commit updates the value of the HTTPONLY_ATTR constant from "HTTPOnly" to the more commonly used "HttpOnly". It makes HTTP communication more consistent.
1 parent ad24492 commit eb730a3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/http/cookiejar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _debug(*args):
5050
logger = logging.getLogger("http.cookiejar")
5151
return logger.debug(*args)
5252

53-
HTTPONLY_ATTR = "HTTPOnly"
53+
HTTPONLY_ATTR = "HttpOnly"
5454
HTTPONLY_PREFIX = "#HttpOnly_"
5555
DEFAULT_HTTP_PORT = str(http.client.HTTP_PORT)
5656
NETSCAPE_MAGIC_RGX = re.compile("#( Netscape)? HTTP Cookie File")

Lib/test/test_http_cookiejar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ def test_mozilla(self):
18821882

18831883
for cookie in c:
18841884
if cookie.name == "foo1":
1885-
cookie.set_nonstandard_attr("HTTPOnly", "")
1885+
cookie.set_nonstandard_attr("HttpOnly", "")
18861886

18871887
def save_and_restore(cj, ignore_discard):
18881888
try:
@@ -1897,7 +1897,7 @@ def save_and_restore(cj, ignore_discard):
18971897
new_c = save_and_restore(c, True)
18981898
self.assertEqual(len(new_c), 6) # none discarded
18991899
self.assertIn("name='foo1', value='bar'", repr(new_c))
1900-
self.assertIn("rest={'HTTPOnly': ''}", repr(new_c))
1900+
self.assertIn("rest={'HttpOnly': ''}", repr(new_c))
19011901

19021902
new_c = save_and_restore(c, False)
19031903
self.assertEqual(len(new_c), 4) # 2 of them discarded on save

0 commit comments

Comments
 (0)