handle headers as both strings and arrays#84
Closed
kellyselden wants to merge 2 commits intoember-fastboot:masterfrom
Closed
handle headers as both strings and arrays#84kellyselden wants to merge 2 commits intoember-fastboot:masterfrom
kellyselden wants to merge 2 commits intoember-fastboot:masterfrom
Conversation
Member
Author
|
I should add that I'm using the standalone fastboot package, without any middleware. |
arjansingh
suggested changes
Oct 4, 2016
arjansingh
left a comment
There was a problem hiding this comment.
Other than the type checking for a string... LGTM.
| let value = headers[header]; | ||
|
|
||
| // convert to array if not already | ||
| if (value.split) { |
There was a problem hiding this comment.
I'd prefer doing an instanceof or typeof check here instead.
d436638 to
2ca176f
Compare
2ca176f to
508e231
Compare
Member
Author
|
I finally found the evidence needed to get this merged. Express turns the https://github.com/expressjs/express/blob/bd47aeb88d28c6cff6e2d8e5378ec73c262e039f/lib/response.js#L805 |
Member
Author
|
cc @danmcclain and @tomdale, I remember on the call you two expressed concern over this change. |
This was referenced Jan 13, 2017
Merged
Member
|
closed by #113 |
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.
When I don't supply the express response in the visit options, everything works fine, but when I do supply it:
The headers parsing fails because sometimes the header values are already arrays and don't have the split function. A sample while debugging:
I don't yet know if this is an issue only I would have for some reason, or it will start turning up in other apps.