-
Notifications
You must be signed in to change notification settings - Fork 195
Using hyper.contrib.HTTP20Adapter with requests.session ignores set-cookie header and does not set cookies. #392
Comments
I have the same issue, did you solve it? |
I urgently hope to support the automatic management of request and response cookies as soon as possible. |
Is there any workaround for this? I have just come across the issue and it is a game breaking problem! |
Same issue. I've confirmed I'm actually receiving the cookies since I can see |
@crablab that fix does not work correctly. it doesn't add all the cookies i see in wireshark |
It is a bit of a dumster fire to be honest 🔥 I might have a look at fixing this myself but I've never looked at the Hyper source before so 🤷♂️ |
#405 appears to fix this issue in both Python2 and Python3. |
@divinehawk I have applied the #405 fix but still no luck... Specifically, what I 'm doing is that I mount hyper.contrib.HTTP20Adapter to a requests.Session in python3 and I am trying to get a specific cookie from the RequestsCookieJar of the response. However, despite the fact that the response headers contain several 'Set-Cookie' headers, the CookieJar remains empty. I also added debug messages inside the FakeOriginalResponse.get_all() method in order to see the contents of the "values" variable that this method returns. I see that "values" contains all of the "Set-Cookie" cookies' values. Am I missing something else? |
Just came up with a solution. In the #405 fix I simply replaced the line And finally I placed the call to Hope this saves someone the 4 weeks I lost over this... |
If I get it right, the HTTP/2 specification (RFC7540 8.1.2 HTTP Header Fields) requires all field names to be in lowercase, so |
@xingzhisg that's what I thought as well and actually this is why it took me 4 weeks to solve this. I just happened to check this out of dispair, in order to be sure that it wasn't creating any problems. And after I checked that it works with it, I then reverted back and cross-checked that it failed without |
I am using hyper.contrib.HTTP20Adapter with requests in python.
When session is started with requests (with HTTP20Adapter) and url is fetched, it does not set cookies as per 'set-cookie' header.
So, session.cookies.get_dict() returns an empty dict {}.
The text was updated successfully, but these errors were encountered: