Skip to content
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

Updating the handling of Set-Cookie in http responses #218

Merged
merged 2 commits into from
Jun 26, 2013

Conversation

dwnichols
Copy link
Contributor

Two small changes to more accurately handle Set-Cookie.

First commit, to handle a response with two cookies in the response header. Commit comment:
When an http response has two Set-Cookie in the header, response['Set-Cookie'] will return a single string. This string will be the two returned cookies separated by a comma, concatenated together. Instead this should use get_fields('Set-Cookie') which returns an array of returned cookie strings.

Second commit to allow '=' within a cookie value. Commit comment:
The syntax of cookies is described in http://www.ietf.org/rfc/rfc2109.txt, section 4.1. Cookies are attribute-value pairs, so split should only return 2 values. This will allow '=' within the value of a cookie.

…-Cookie']

will return a single string. This string will be the two returned cookies
separated by a comma, concatenated together. Instead this should use
get_field('Set-Cookie') which returns an array of returned cookie strings.
….txt,

section 4.1. Cookies are attribute-value pairs, so split should only return 2
values. This will allow '=' within the value of a cookie.
jnunemaker pushed a commit that referenced this pull request Jun 26, 2013
Updating the handling of Set-Cookie in http responses
@jnunemaker jnunemaker merged commit b68e948 into jnunemaker:master Jun 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants