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:
parent
566ca9e58d
commit
5c01b1e1a0
|
@ -154,7 +154,7 @@ class XMLHttpRequestBase {
|
|||
this._lowerCaseResponseHeaders =
|
||||
Object.keys(headers).reduce((lcaseHeaders, headerName) => {
|
||||
lcaseHeaders[headerName.toLowerCase()] = headers[headerName];
|
||||
return headers;
|
||||
return lcaseHeaders;
|
||||
}, {});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue