react-native/React/Base
Adam Comella ee8496f364 iOS: Support HTTP headers for source prop on <Image> components
Summary:
Allows developers to specify headers to include in the HTTP request
when fetching a remote image. For example, one might leverage this
when fetching an image from an endpoint that requires authentication:

```
<Image
  style={styles.logo}
  source={{
    uri: 'http://facebook.github.io/react/img/logo_og.png',
    headers: {
      Authorization: 'someAuthToken'
    }
  }}
/>
```

Note that the header values must be strings.

Works on iOS and Android.

**Test plan (required)**

- Ran a small example like the one above on iOS and Android and ensured the headers were sent to the server.
- Ran a small example to ensure that \<Image\> components without headers still work.
- Currently using this code in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/7338

Reviewed By: javache

Differential Revision: D3371458

Pulled By: nicklockwood

fbshipit-source-id: cdb24fe2572c3ae3ba82c86ad383af6d85157e20
2016-06-01 10:43:28 -07:00
..
RCTAssert.h Reduced work done on main thread by RCTImageLoader 2015-11-17 07:21:29 -08:00
RCTAssert.m Add Random Access Module file names to stack traces 2016-05-06 05:54:23 -07:00
RCTBatchedBridge.m add support to provide fallback-sourceURL: in case primary-sourceURL fails to load 2016-05-25 10:28:27 -07:00
RCTBridge+Private.h move `RCTBatchedBridge` interface to a private header 2016-04-01 06:54:49 -07:00
RCTBridge.h Clean up RCTEventDispatcher code 2016-04-28 05:48:21 -07:00
RCTBridge.m Add Shortcut "Double R" to Reload JS in iOS 2016-06-01 03:43:27 -07:00
RCTBridgeDelegate.h add support to provide fallback-sourceURL: in case primary-sourceURL fails to load 2016-05-25 10:28:27 -07:00
RCTBridgeMethod.h Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTBridgeModule.h Standardize Error objects for Promises 2016-01-19 12:20:37 -08:00
RCTBundleURLProvider.h Added RCTBundleURLProvider 2016-05-31 04:59:56 -07:00
RCTBundleURLProvider.m Added RCTBundleURLProvider 2016-05-31 04:59:56 -07:00
RCTConvert.h Replaced RegExp method parser with recursive descent 2015-12-10 10:12:29 -08:00
RCTConvert.m iOS: Support HTTP headers for source prop on <Image> components 2016-06-01 10:43:28 -07:00
RCTDefines.h Implement asm trampoline rather forwardInvocation 2015-10-20 04:14:09 -07:00
RCTDisplayLink.h Pull CADisplayLink into a separate file 2016-03-29 19:53:20 -07:00
RCTDisplayLink.m make RCTFBSystrace actually work 2016-05-13 17:29:00 -07:00
RCTEventDispatcher.h Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RCTEventDispatcher.m Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RCTFrameUpdate.h Pause JS DisplayLink if nothing to process. 2015-09-29 09:22:10 -07:00
RCTFrameUpdate.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTImageSource.h iOS: Support HTTP headers for source prop on <Image> components 2016-06-01 10:43:28 -07:00
RCTImageSource.m iOS: Support HTTP headers for source prop on <Image> components 2016-06-01 10:43:28 -07:00
RCTInvalidating.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTJavaScriptExecutor.h Add context executor API for sync hooks 2016-01-05 08:00:38 -08:00
RCTJavaScriptLoader.h seek & read RAM Bundle 2016-03-17 10:35:28 -07:00
RCTJavaScriptLoader.m provide verbose error-message on bundle-load-failure 2016-05-23 11:13:24 -07:00
RCTKeyCommands.h Add Shortcut "Double R" to Reload JS in iOS 2016-06-01 03:43:27 -07:00
RCTKeyCommands.m Followup for Add Shortcut "Double R" to Reload JS in iOS 2016-06-01 08:43:29 -07:00
RCTLog.h Provide log source to handler 2015-11-11 06:44:30 -08:00
RCTLog.m Added unit tests for module init 2016-03-01 09:44:37 -08:00
RCTModuleData.h Initialize bridge on a background queue 2016-03-07 09:31:26 -08:00
RCTModuleData.m avoid waiting on the main thread just to send a notification 2016-05-13 17:29:00 -07:00
RCTModuleMethod.h Implement Android's dispatchViewManagerCommand interface on iOS 2016-01-06 05:58:37 -08:00
RCTModuleMethod.m Parse _Nonnull and _Nullable attributes in RCTParseMethodSignature 2016-04-12 17:45:25 -07:00
RCTNullability.h Replaced RegExp method parser with recursive descent 2015-12-10 10:12:29 -08:00
RCTParserUtils.h Replaced RegExp method parser with recursive descent 2015-12-10 10:12:29 -08:00
RCTParserUtils.m Replaced RegExp method parser with recursive descent 2015-12-10 10:12:29 -08:00
RCTPerformanceLogger.h Implement RCTJSCWrapper 2016-05-31 12:58:25 -07:00
RCTPerformanceLogger.m Implement RCTJSCWrapper 2016-05-31 12:58:25 -07:00
RCTRootView.h remove dead code 2016-02-29 10:09:54 -08:00
RCTRootView.m make RCTFBSystrace actually work 2016-05-13 17:29:00 -07:00
RCTRootViewDelegate.h Prevent RCTRootView delegate call 2015-11-13 08:28:28 -08:00
RCTRootViewInternal.h Introduction of RCTRootViewDelegate 2015-10-26 15:41:36 -07:00
RCTTouchEvent.h RCTTouchEvent's init takes coalescing key 2016-04-01 06:54:49 -07:00
RCTTouchEvent.m improved description for RCTTouchEvent 2016-05-24 05:13:27 -07:00
RCTTouchHandler.h API for cancelling RCTTouchHandler 2016-01-21 13:46:52 -08:00
RCTTouchHandler.m different coalescing key for `touchCancel` events 2016-05-12 08:11:24 -07:00
RCTURLRequestDelegate.h Refactored networking logic out into RCTDownloadTask 2015-07-23 04:00:31 -08:00
RCTURLRequestHandler.h [ReactNative] Refactor RCTDataManager to support pluggable data source modules (RCTURLRequestHandlers) 2015-06-09 12:27:06 -08:00
RCTUtils.h ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
RCTUtils.m ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
RCTWebSocketProxy.h Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
RCTWebSocketProxyDelegate.h Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00