Fix incorrect lowercase response headers set for XHR responses

Summary:
Trivial change to fix the lowercase response headers set for XHR responses.

What would happen is the first iterated header wouldn't be part of `_lowerCaseResponseHeaders`.
Also it would mutate the original `responseHeaders` object, mixing lowercase headers with the original values.
Closes https://github.com/facebook/react-native/pull/1876
Github Author: Jean Regisser <jean.regisser@gmail.com>
This commit is contained in:
Jean Regisser 2015-07-07 14:57:05 -07:00
parent 566ca9e58d
commit 5c01b1e1a0
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class XMLHttpRequestBase {
this._lowerCaseResponseHeaders =
Object.keys(headers).reduce((lcaseHeaders, headerName) => {
lcaseHeaders[headerName.toLowerCase()] = headers[headerName];
return headers;
return lcaseHeaders;
}, {});
}