diff --git a/RCTAssetsLibraryRequestHandler.m b/RCTAssetsLibraryRequestHandler.m index d818f336d..a7a44bbb4 100644 --- a/RCTAssetsLibraryRequestHandler.m +++ b/RCTAssetsLibraryRequestHandler.m @@ -11,6 +11,7 @@ #import #import +#import #import "RCTBridge.h" #import "RCTUtils.h" @@ -53,10 +54,13 @@ RCT_EXPORT_MODULE() ALAssetRepresentation *representation = [asset defaultRepresentation]; NSInteger length = (NSInteger)representation.size; + + + CFStringRef MIMEType = UTTypeCopyPreferredTagWithClass((__bridge CFStringRef _Nonnull)(representation.UTI), kUTTagClassMIMEType); NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL - MIMEType:representation.UTI + MIMEType:(__bridge NSString *)(MIMEType) expectedContentLength:length textEncodingName:nil];