-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
feat: add sameSite parameter to unset_cookie #2140
Conversation
Tests: added a test case to test_unset_cookies and to on_get in CookieUnset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like a great start, thanks! 💯
In order to merge this, we also need a towncrier news fragment describing the new feature; the file ought to be named docs/_newsfragments/2124.newandimproved.rst
.
I would also like to see a couple more combinations of samesite
covered in the unit tests in conjunction with set_/unset_cookie(...)
.
Furthermore, it seems that some CI gates are failing, such as pep8
& blue
. Tip: you can simply install blue
(pip install -U blue
) into your environment and reformat the code (blue .
).
docs/api/cookies.rst
Outdated
|
||
When unsetting a cookie, :py:meth:`~falcon.Response.unset_cookie`, | ||
the default `SameSite` setting of the unset cookie is ``'Lax'``, but can be changed | ||
by setting the 'samsite' kwarg. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo 'samsite'
(sic) ➡️ 'samesite'
.
Codecov Report
@@ Coverage Diff @@
## master #2140 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 62 62
Lines 6789 6789
Branches 1095 1095
=========================================
Hits 6789 6789
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Excellent, thanks for the comments, I'll push an update asap! |
…te; added towncrier news fragment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to revert docs/changes/4.0.0.rst
-- we don't want to render that file yet, we'll probably do that at some time around the first beta release.
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
(I'll tweak the newsfragment later a bit because we have some others that require more cleanup anyway.)
should also add @TigreModerata to the contridutors |
Yes, we run that script from time to time now, particularly before releases 🙂 |
forgot we automated that! |
Thanks to all - I will try to contribute more in the future, when I know how :) |
Thank you for contributing @TigreModerata! |
Summary of Changes
Added samesite parameter to unset_cookies, defaulting to 'Lax'.
Tests: added a test case to test_unset_cookies and to on_get in CookieUnset
Docs: added explanation of new parameter to cookies.rst
Related Issues
Fixes #2124
Pull Request Checklist
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!
If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.
docs/
.docs/
.versionadded
,versionchanged
, ordeprecated
directives.docs/_newsfragments/
, with the file name format{issue_number}.{fragment_type}.rst
. (Runtowncrier --draft
to ensure it renders correctly.)If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
PR template inspired by the attrs project.