Enable proxy response to have multiple Set-Cookie raw headers #1101#1102
Closed
kriswill wants to merge 1 commit intohttp-party:masterfrom
Closed
Enable proxy response to have multiple Set-Cookie raw headers #1101#1102kriswill wants to merge 1 commit intohttp-party:masterfrom
kriswill wants to merge 1 commit intohttp-party:masterfrom
Conversation
jcrugzz
reviewed
Dec 4, 2016
Contributor
jcrugzz
left a comment
There was a problem hiding this comment.
Comments are for the future as I will take care of this and push it out since it is broken for this case currently. Thanks for this!
| // message.rawHeaders is added in: v0.11.6 | ||
| // https://nodejs.org/api/http.html#http_message_rawheaders | ||
| if (proxyRes.rawHeaders != undefined) { | ||
| if (proxyRes.rawHeaders !== undefined) { |
Contributor
There was a problem hiding this comment.
The current code here supports if it is undefined or null, we should be sure that it is strictly undefined.
| var rewriteCookieDomainConfig = options.cookieDomainRewrite, | ||
| // In proxyRes.rawHeaders Set-Cookie headers are sparse. | ||
| // so, we'll collect Set-Cookie headers, and set them in the response as an array. | ||
| set_cookies = [], |
| if (header != undefined) { | ||
| if (rewriteCookieDomainConfig && key.toLowerCase() === 'set-cookie') { | ||
| header = common.rewriteCookieDomain(header, rewriteCookieDomainConfig); | ||
| if (key === 'Set-Cookie' || key === 'set-cookie') { |
Contributor
There was a problem hiding this comment.
we can still do key.toLowerCase() === 'set-cookie'
Contributor
|
cherry-picked, thanks! |
Contributor
|
@kriswill Thanks to fix this issue. and sorry for any inconvenience. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of proxy HTTP raw headers response processing in 1.16.0 fails to account for multiple
Set-Cookieheaders. This patch accounts for multiple Set-Cookie header, and sets the source response headers to an array.