-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Client] Inconsistent quoted cookie handling #5397
Comments
I've added the tests for it, but haven't looked at how to fix it yet. Feel free to propose a fix into that PR if you've got an idea. |
I would like to try to solve this. suspect this is the job of the SimpleCookie class |
Go ahead. Should be easy to narrow down from the code in that test. I suspect it happens at the |
I've had a look at this now, and it seems non-trivial. My suspicion is that the But, if I remove that check (and move the remaining if statements into an |
If you remove quotes from the cookie, then both options works fine:
Output:
Updating cookies in client session works as well as a result |
Well, yes, because the issue is about quoted cookies. :P |
🐞 Describe the bug
Quoted cookies are unquoted if domain attribute is not set.
💡 To Reproduce
Run this code:
Outputs
Cookie with
domain
attribute is quoted, and cookie withoutdomain
attribute is not quoted💡 Expected behavior
I think if user inputs a quoted cookie, the quotes should not be dropped.
At least it should be consistent, and not dependent on
domain
attribute.📋 Logs/tracebacks
📋 Your version of the Python
Python 3.8.5
📋 Your version of the aiohttp/yarl/multidict distributions
📋 Additional context
Additional code to what I think is the cause
Also, these example might be a bit of a stretch because official docs say that cookies should be passed as
dict
.But is there any reason why I shouldn't be able to send quoted cookies?
The text was updated successfully, but these errors were encountered: