Commit Graph

9 Commits

Author SHA1 Message Date
Jean Regisser 5c01b1e1a0 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>
2015-07-07 15:05:45 -08:00
Andy Street 0116abed4f [react_native] JS files from D2164109: [react_native] Fix JS error stacktraces on Android 2015-06-19 04:32:40 -08:00
Nick Lockwood e00b9ac8f3 Added incremental XMLHttpRequest updates
Summary:
@public

Previously, our XMLHttpRequest implementation would only update the readyState when the download was fully completed. This diff adds support for receiving incremental data updates as the download happens, which can be monitored by adding the onreadystatechange event handler.

As a performance optimization, incremental data updates are only sent if the onreadystatechanged handler has been set in the JS, otherwise it just sends the whole data block once download is complete, as before.

Test Plan:
* Run the UIExplorer XMLHttpRequest example (in both OSS and Catalyst) to see incremental downloads working.
* Run the Movies app to see regular (non-incremental) downloads in action
* Run any network-based app in Catalyst shell to verify RKDataManager still works
2015-06-05 15:21:25 -08:00
Philipp von Weitershausen 7069e4cd3f XMLHttpRequest: ignore case for request headers
Summary:
HTTP headers are case-insensitive, so we should treat them that way when they're being set on `XMLHttpRequest`.
Closes https://github.com/facebook/react-native/pull/1381
Github Author: Philipp von Weitershausen <philikon@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-26 08:15:42 -08:00
Philipp von Weitershausen c6ed85afcc new XMLHttpRequest().status is a number, not a string
Summary:
See http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest
Closes https://github.com/facebook/react-native/pull/1356
Github Author: Philipp von Weitershausen <philikon@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-22 16:42:15 -08:00
Ryan Pastorelle 8a74a9f7c3 Force `responseHeaders` to lower case to respect case-insensitivity
Summary:
`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 (https://github.com/visionmedia/superagent/issues/636).
Closes https://github.com/facebook/react-native/pull/1138
Github Author: Ryan Pastorelle <rpastorelle@yahoo.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-05 14:09:40 -08:00
Andy Street eafe93096c [react_native] JS files from D2012956: [react_native] Never return null from XHR.getAllResponseHeaders if request has completed 2015-04-22 09:05:42 -08:00
Josh Zana 368e507b38 Implement XmlHttpRequestBase#getAllResponseHeaders and getResponseHeader
Summary:
Used https://github.com/facebook/react-native/pull/382 as inspiration
but modified to return null instead of undefined as per the spec at
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest

This unblocks use of Dropbox.js within a react-native app, as well
as any other libraries that make use of these methods in XHR usage.

Closes https://github.com/facebook/react-native/issues/872
Closes https://github.com/facebook/react-native/pull/892
Github Author: Josh Zana <joshzana@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-21 16:45:32 -08:00
Olivia Bishop 40d71e6c5b JS files from D1936817: Add to XMLHttpRequest android and share code with ios 2015-03-24 14:25:20 -08:00