Skip to content

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

Merged
jnunemaker merged 2 commits intojnunemaker:masterfrom
dwnichols:master
Jun 26, 2013
Merged

Updating the handling of Set-Cookie in http responses#218
jnunemaker merged 2 commits intojnunemaker:masterfrom
dwnichols:master

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