-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-2190: make MozillaCookieJar handle HTTP-only cookies #22798
Conversation
9be98f0
to
a3b7f8b
Compare
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.
Two minor comments but LGTM otherwise, the relevant paths are being tested and everything else seems in order.
Other than unnecessarily pushing a new commit… is there any way to retrigger the failed builds (probably an Azure issue?) so that this PR doesn't have the scarlet ❌ next to it? |
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.
Doc change is good. Blurb could use minor change. You can add yourself to misc.ACKS, but that is best done when merge is close. I need to look more before I have an opinion on .py files.
Misc/NEWS.d/next/Library/2020-10-20-00-34-00.bpo-2190.WNIr6.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2020-10-20-00-34-00.bpo-2190.WNIr6.rst
Outdated
Show resolved
Hide resolved
Closing and reopening the PR. |
Sometimes coredevs, at least, can trigger a rerun of just one group of tests. But, after 23 days, this is not possible for me for Pipelines. And this does not matter as commits are needed first to resolve the merge conflicts (due, I believe, to another cookiejar patch being merged) and second for Zackery's suggestions. |
This enabled MozillaCookieJar to correctly .load cookies marked as HTTP-only. (See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies for the meaning of this attribute.) As discussed in bpo-2190, this format is no longer used by Firefox itself, but is still in common use due to its adoption by cURL.
…laCookieJar Renamed from 'http_only' → 'httponly', due to preexisting support for this name in 'http.cookies' and its tests; the names of the Python properties match the lowercase names of the keywords in the 'Set-Cookie' HTTP header.
Updated the PR to comply with PEP-8 per his suggestions.
It's a bit surprising, but it appears that the other patch (#17471) addressed the exact same issue… or rather, it addressed bpo-38976, which is essentially a duplicate of this bpo-2190. |
HTTP-only cookies for MozillaCookieJar was introduced in #17471 |
Thanks for your contribution @dlenski. I am not sure how we couldn't notice the overlap of both the issue and independent work earlier. |
This resolves a longstanding issue with
http.cookiejar.MozillaCookieJar
, namely the fact that it does not know how to load or save cookies marked HTTP-only in the on-disk file format.As discussed in bpo-2190, this file format is not obsolete (despite the fact that Mozilla/Firefox browsers no longer store cookies in it).
cURL's
-b
/-c
options still load and store cookies in this format, including marking cookies as HTTP-only in this way.With these changes applied,
MozillaCookieJar
will….load
HTTP-only cookies,Cookie.httponly
attribute to mark them as such, and.save
cookies withhttponly == True
https://bugs.python.org/issue2190