Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quoted cookie #5398

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/5397.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix pre-quoted cookies when domain is specified.
4 changes: 4 additions & 0 deletions tests/test_cookiejar.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,17 @@ async def test_domain_filter_ip_cookie_receive(
("custom-cookie=value/one;", 'Cookie: custom-cookie="value/one"', True),
("custom-cookie=value1;", "Cookie: custom-cookie=value1", True),
("custom-cookie=value/one;", "Cookie: custom-cookie=value/one", False),
('foo="quoted_value"', 'Cookie: foo="quoted_value"', True),
('foo="quoted_value"; domain=127.0.0.1', 'Cookie: foo="quoted_value"', True),
],
ids=(
"IP domain preserved",
"no shared cookie",
"quoted cookie with special char",
"quoted cookie w/o special char",
"unquoted cookie with special char",
"pre-quoted cookie",
"pre-quoted cookie with domain",
),
)
async def test_quotes_correctly_based_on_input(
Expand Down
Loading