__contains__ fails for Cookies instance with a duplicate key
#3039
Unanswered
alex-postolache
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I've encountered the following issue:
name in cookieswill fail with aCookieConflictwhen aCookieinstance contains multiple cookies with the same name (but different domains/paths). Code to reproduce:I've tracked the issue to the fact that
Cookiesdoes not implement__contains__, but it defers to its parentMapping.__contains__. This in turn will trigger a call toCookies.get(name)and hit the following code path:My hunch is that we should get a
Trueinstead since such a cookie exists in the jar.Do you think it's correct to have a
__contains__defined onCookie, like the one below?Beta Was this translation helpful? Give feedback.
All reactions