Fix setting multiple cookie headers in the response#36
Closed
sandydoo wants to merge 4 commits intoember-fastboot:masterfrom
Closed
Fix setting multiple cookie headers in the response#36sandydoo wants to merge 4 commits intoember-fastboot:masterfrom
sandydoo wants to merge 4 commits intoember-fastboot:masterfrom
Conversation
Cookies were previously set together with the other headers. This meant that if you were to set more than one cookie in FastBoot, each subsequent cookie would overwrite the `Set-Cookie` header and only the last cookie would be sent in the response. This commit extracts the cookie headers, dedups them by name and sets the header at once to set multiple cookies.
1b96bcb to
7fd77ab
Compare
|
Any update on this? |
|
Ping @rwjblue :-) |
|
Also waiting for this... |
rwjblue
reviewed
Jan 25, 2019
Member
rwjblue
left a comment
There was a problem hiding this comment.
Made some suggested changes inline, definitely 👍 on getting this fixed...
- Use `Map` to store cookies. - Set cookie header only when cookies are present. Co-Authored-By: sandydoo <sandydoo@users.noreply.github.com>
Author
🔥 Great stuff! Any thoughts on how we can get a working test for this? |
Author
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.
Patches #33 and mainmatter/ember-cookies#133.
Cookies were previously set together with the other headers. This meant that if you were to set more than one cookie in FastBoot, each subsequent cookie would overwrite the
Set-Cookieheader and only the last cookie would be sent in the response. This particularly affectsember-simple-auth.This commit extracts the cookie headers, dedups them by name and sets the header at once to set multiple cookies.
This doesn't use
res.cookiebecause we're already dealing with serialized headers.Should be compliant down to node 4.
Todo: