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

Force responseHeaders to lower case to respect case-insensitivity #1138

Closed
wants to merge 2 commits into from
Closed

Force responseHeaders to lower case to respect case-insensitivity #1138

wants to merge 2 commits into from

Conversation

rpastorelle
Copy link
Contributor

XMLHttpRequest.getResponseHeader is case-insensitive, therefor the React-Native implementation needs to mimic this behavior as to not break libraries that are dependent on this.

There is a corresponding issue in superagent but this is the root cause (ladjs/superagent#636).

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 4, 2015
@rpastorelle rpastorelle changed the title Force responseHeaders to lower case to enforce case-insensitivity Force responseHeaders to lower case to respect case-insensitivity May 4, 2015
// Headers should be case-insensitive
for (var header in responseHeaders) {
responseHeaders[header.toLowerCase()] = responseHeaders[header];
delete responseHeaders[header];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the header is already in lower case this will remove it.

…esponse headers

This prevents already-lower-cased headers from being deleted (which the previous commit was doing)
@rpastorelle
Copy link
Contributor Author

@frantic Thanks. The issue you mentioned should be taken care of with the latest commit.

@frantic
Copy link
Contributor

frantic commented May 4, 2015

@rpastorelle - thanks, will pull this in soon

@frantic frantic closed this in 8a74a9f May 7, 2015
ayushjainrksh pushed a commit to MLH-Fellowship/react-native that referenced this pull request Jul 2, 2020
mganandraj pushed a commit to mganandraj/react-native that referenced this pull request May 13, 2022
…m-validation

Add debug logging to -[RCTSRWebSocket _connect]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants