fix(cookies): allow more characters in cookie names, as defined by more recent RFCs#490
Merged
fix(cookies): allow more characters in cookie names, as defined by more recent RFCs#490
Conversation
91d3f73 to
2feaceb
Compare
…re recent RFCs Python's http.cookies library is very strict, and throws an exception when a cookie-name violates older RFC definitions of the name. This is reflected back as a 500. But the user has no indication that he was the cause of it. More recent RFCs seem to allow for more characters, which is also reflected in the http.cookies library, but not used. So switch to that more relaxed definition of valid cookie name. Still, illegal names should not return 500 in aiohttp, but that is a problem for another time.
2feaceb to
d22003d
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #490 +/- ##
==========================================
+ Coverage 83.68% 83.69% +0.01%
==========================================
Files 52 52
Lines 2770 2773 +3
Branches 430 430
==========================================
+ Hits 2318 2321 +3
Misses 342 342
Partials 110 110
☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python's http.cookies library is very strict, and throws an exception when a cookie-name violates older RFC definitions of the name. This is reflected back as a 500. But the user has no indication that he was the cause of it.
More recent RFCs seem to allow for more characters, which is also reflected in the http.cookies library, but not used. So switch to that more relaxed definition of valid cookie name.
Still, illegal names should not return 500 in aiohttp, but that is a problem for another time.