Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain request header casing. #98

Closed

Conversation

elyobo
Copy link

@elyobo elyobo commented Mar 22, 2016

While headers are meant to be case sensitive, many servers do not
respect this. Node maintains the casing of the request headers in order
to work with this and http-browserify should do likewise in order to be
consistent with the node implementation.

This patch maintains the casing with which the header was last set, e.g.
setting header "fOo", then header "Foo" will still only send one header,
but will use the final casing "Foo". This is compatible with the node implementation.

@elyobo
Copy link
Author

elyobo commented Mar 22, 2016

Resolves #91

@elyobo elyobo force-pushed the maintain-request-header-case branch from 59bf2a7 to fe1c803 Compare March 23, 2016 00:10
@elyobo
Copy link
Author

elyobo commented Mar 23, 2016

Added tests.

Note that this fix maintains the case insensitive access (to set, get and delete) but still sends the headers in the case given.

While headers are meant to be case sensitive, many servers do not
respect this.  Node maintains the casing of the request headers in order
to work with this and http-browserify should do likewise in order to be
consistent with the node implementation.

This patch maintains the casing with which the header was last set, e.g.
setting header "fOo", then header "Foo" will still only send one header,
but will use the final casing "Foo". This is compatible with the node
implementation in
https://github.com/nodejs/node/blob/85ab4a5f1281c4e1dd06450ac7bd3250326267fa/lib/_http_outgoing.js
@elyobo elyobo force-pushed the maintain-request-header-case branch from fe1c803 to 6493496 Compare March 23, 2016 00:14
@elyobo
Copy link
Author

elyobo commented Mar 23, 2016

@substack I notice that there hasn't been a lot of activity here recently (big queue of unmerged PRs, mainly old) - is this still maintained?

@elyobo
Copy link
Author

elyobo commented Jan 2, 2017

Please merge or close if there's no interesting in fixing this bug.

@elyobo elyobo closed this Jan 3, 2017
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.

1 participant