Keep original letter case of response header keys#1098
Merged
jcrugzz merged 3 commits intohttp-party:masterfrom Dec 2, 2016
Merged
Keep original letter case of response header keys#1098jcrugzz merged 3 commits intohttp-party:masterfrom
jcrugzz merged 3 commits intohttp-party:masterfrom
Conversation
messege.rawHeaders was added in v0.11.6
42fe657 to
d3d7cc2
Compare
jcrugzz
requested changes
Dec 1, 2016
Contributor
jcrugzz
left a comment
There was a problem hiding this comment.
Overall this seems reasonable, just DRY it up a little bit
| for (var i = 0; i < proxyRes.rawHeaders.length; i += 2) { | ||
| var key = proxyRes.rawHeaders[i]; | ||
| var header = proxyRes.rawHeaders[i + 1]; | ||
| if (header != undefined) { |
Contributor
There was a problem hiding this comment.
can we put this duplicate logic in a function we call with key and header?
function setHeader(key, header) {}
Contributor
Author
|
@jcrugzz Thank you for your quick response 😄 I fixed. |
49492a7 to
74fa39b
Compare
74fa39b to
605a05f
Compare
jcrugzz
approved these changes
Dec 2, 2016
Contributor
|
thanks! |
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.
This PR fixes the issue #1029
In RFC, HTTP header key is case-insensitive (ref: nodejs/node-v0.x-archive#1954).
But, proxy server should care not to change the original request unintentionally ✨