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
comma in case: join multiple Set-Cookie Headers #3957
Comments
Requests makes no promises about leaving headers in the form they are received from the server. Right now, I highly recommend you use the cookiejar Requests uses to store cookies rather than extracting them from the headers: we correctly insert them in there. Longer term, we should probably add a fix to exclude the |
This has bitten us and cost us quite a few hours. I'd like to vote to leave |
Hi, there is a way to parse headers correctly with https://github.com/Ousret/kiss-headers |
In order to access the unmerged header lines, use the underlying resp = requests.get('https://myurl.com')
print(resp.raw.headers.items()) Yields (for example):
|
In my case, I had to do |
Many web-apps send cookie in multiple Set-Cookie headers, one header for one cookie. Requests joins this headers in one big header separate by comma.
From same webapp to requests.get
In requests:
resp.headers this look like
Firefox, IE, Chrome invalid interpreted this cookies because separater is comma but in field EXPIRES comma separate day and date.
Principal problem in modification traffic. In my opinion then server send multiple headers lib must return multiple headers
The text was updated successfully, but these errors were encountered: