Skip to content

Commit 6c77da5

Browse files
Bump aiohttp from 3.12.6 to 3.12.12 (#1099)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <[email protected]>
1 parent cbbd70f commit 6c77da5

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-e .
2-
aiohttp==3.12.6
2+
aiohttp==3.12.12
33
aiomcache==0.8.2
44
cryptography==45.0.4
55
docker==7.1.0

tests/test_cookie_storage.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import time
3+
from http.cookies import SimpleCookie
34
from typing import Any, Dict, MutableMapping, cast
45

56
from aiohttp import web
@@ -99,10 +100,22 @@ async def handler(request: web.Request) -> web.StreamResponse:
99100
make_cookie(client, {"a": 1, "b": 2})
100101
resp = await client.get("/")
101102
assert resp.status == 200
102-
assert (
103-
'Set-Cookie: AIOHTTP_SESSION="{}"; '
104-
"domain=127.0.0.1; httponly; Path=/".upper()
105-
) == resp.cookies["AIOHTTP_SESSION"].output().upper()
103+
104+
# Check the actual Set-Cookie header instead of resp.cookies
105+
# which used to leak the cookie jar details back into the resp.cookies
106+
set_cookie_header = resp.headers.get("Set-Cookie")
107+
assert set_cookie_header is not None
108+
109+
# Parse the header
110+
cookie = SimpleCookie()
111+
cookie.load(set_cookie_header)
112+
assert "AIOHTTP_SESSION" in cookie
113+
114+
# Verify the cookie was cleared (empty value)
115+
morsel = cookie["AIOHTTP_SESSION"]
116+
assert morsel.value == "{}"
117+
assert morsel["path"] == "/"
118+
assert morsel["httponly"] is True
106119

107120

108121
async def test_dont_save_not_requested_session(aiohttp_client: AiohttpClient) -> None:

0 commit comments

Comments
 (0)