GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
During the development of a HTTP proxy (which uses flask for the response view generation) I came into the issue of setting multiple header values.
The problem is that I get multiple Set-Cookies response from the upstream HTTP server, which I have to insert into flask's response. But currently it seems it's impossible due to the dictionary interface.
Use resp.headers.add('key', 'value') instead of resp.headers['key'] = 'value' to set more than one.
resp.headers['key'] = 'value'
This way I get one Set-Cookie header, which it seems not really the same as having two (the application first expires the cookie then sets a new, in two Set-Cookie headers).
You mean something else replaces the header? Can you provide a testcase?
Well, I'm not quite an expert of browsers.
The main issue is/was is this:
Drupal sends two set-cookie headers when authenticating and that's what I would like to 'proxy' to the client and this is what I have problems with.
But after reading that the solution is easy: I should drop the first (invalid) cookie and only use the second. Which is not quite easy to get from httplib either (there's another case for that with the solution).
So sorry for the noise, this is a Drupal idiotism for which I could find the solution.
Thanks for the great job.