react-native/React
Janic Duplessis 3ce36698de Validate the content type of the bundle returned by the packager
Summary:
When using the packager behind something like an http tunnel it is possible something else than JS is returned, in that case throw an error instead of trying to parse it.

This is useful for Expo since the packager runs behind ngrok. This allows to intercept that error and show a more meaningful error message based on the ngrok response.

**Test plan**
Tested by changing the packager to return text/html content type and validate that the error shows up properly.
Also tested that it works when multipart response is disabled.

<img width="354" alt="screen shot 2017-07-19 at 8 01 58 pm" src="https://user-images.githubusercontent.com/2677334/28394905-39e86d52-6cbe-11e7-9059-13a85816a57e.png">
Closes https://github.com/facebook/react-native/pull/15112

Differential Revision: D5459395

Pulled By: shergin

fbshipit-source-id: aaea7ab2e1311ee8dc10feb579adf9b9701d8d4c
2017-07-19 19:10:00 -07:00
..
Base Validate the content type of the bundle returned by the packager 2017-07-19 19:10:00 -07:00
CxxBridge Add a delegate hook for providing a different JS implementation 2017-07-19 13:49:32 -07:00
CxxModule Replace -[RCTConvert folly_dynamic:] with direct calls to convertIdToFollyDynamic 2017-07-10 05:31:04 -07:00
CxxUtils Explicitly cast to (bool) where needed on objc with folly::dynamic 2017-04-18 15:36:20 -07:00
DevSupport Add app name to inspector device url 2017-07-19 11:47:44 -07:00
Executors Remove RCTBatchedBridge rule and all uses from the tree 2017-04-19 17:00:43 -07:00
Inspector Add app name to PageInfo 2017-07-19 11:47:44 -07:00
Modules Unified usage of RCTAssertUIManagerQueue 2017-07-18 15:15:59 -07:00
Profiler Fix memory leak in RN fbsystrace support 2017-05-15 03:47:15 -07:00
React.xcodeproj Add a delegate hook for providing a different JS implementation 2017-07-19 13:49:32 -07:00
ReactLegacy.xcodeproj Make RCTSamplingProfilerPackagerMethod not depend on RCTBridge 2017-06-15 12:07:34 -07:00
Views ScrollView: Couple of unnecessary checks was removed from RCTCustomScrollView 2017-07-18 14:46:22 -07:00
third-party.xcconfig More attempts to fix Travis CI runs 2017-05-10 04:32:54 -07:00