Merge pull request #1092 from react-native-community/chore/disable-ios-headers

Disable HTTP headers on iOS since it uses a private API
This commit is contained in:
Hampton Maxwell 2018-06-26 15:43:22 -07:00 committed by GitHub
commit f6dea66cd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,9 +334,12 @@ static NSString *const timedMetadata = @"timedMetadata";
if (isNetwork) { if (isNetwork) {
NSMutableDictionary *assetOptions = [[NSMutableDictionary alloc]init]; NSMutableDictionary *assetOptions = [[NSMutableDictionary alloc]init];
/* Per #1091, this is not a public API. We need to either get approval from Apple to use this
* or use a different approach.
if ([headers count] > 0) { if ([headers count] > 0) {
[assetOptions setObject:headers forKey:@"AVURLAssetHTTPHeaderFieldsKey"]; [assetOptions setObject:headers forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
} }
*/
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
[assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey]; [assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey];