__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
-
Hey there,
I've encountered the following issue:
name in cookies
will fail with aCookieConflict
when aCookie
instance contains multiple cookies with the same name (but different domains/paths). Code to reproduce:I've tracked the issue to the fact that
Cookies
does 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
True
instead 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