mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Avoid re-encoding images when uploading local files"
Summary: This was causing an upload error in FB Dating, will need to re-land with the fix. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D29320144 fbshipit-source-id: 5d09dd2171b5696afe89cffa064947f0a0bb413d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f33e6f08b2
commit
e83feffeba
@@ -45,8 +45,6 @@
|
||||
- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request
|
||||
completionBlock:(RCTURLRequestCompletionBlock)completionBlock;
|
||||
|
||||
- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request handler:(id<RCTURLRequestHandler>)handler completionBlock:(RCTURLRequestCompletionBlock)completionBlock;
|
||||
|
||||
- (void)addRequestHandler:(id<RCTNetworkingRequestHandler>)handler;
|
||||
|
||||
- (void)addResponseHandler:(id<RCTNetworkingResponseHandler>)handler;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
#import <React/RCTHTTPRequestHandler.h>
|
||||
#import <React/RCTFileRequestHandler.h>
|
||||
|
||||
#import "RCTNetworkPlugins.h"
|
||||
|
||||
@@ -394,9 +393,9 @@ RCT_EXPORT_MODULE()
|
||||
}
|
||||
NSURLRequest *request = [RCTConvert NSURLRequest:query[@"uri"]];
|
||||
if (request) {
|
||||
|
||||
__block RCTURLRequestCancellationBlock cancellationBlock = nil;
|
||||
id<RCTURLRequestHandler> handler = [self.moduleRegistry moduleForName:"FileRequestHandler"];
|
||||
RCTNetworkTask *task = [self networkTaskWithRequest:request handler:handler completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
RCTNetworkTask *task = [self networkTaskWithRequest:request completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
dispatch_async(self->_methodQueue, ^{
|
||||
cancellationBlock = callback(error, data ? @{@"body": data, @"contentType": RCTNullIfNil(response.MIMEType)} : nil);
|
||||
});
|
||||
@@ -677,19 +676,6 @@ RCT_EXPORT_MODULE()
|
||||
return task;
|
||||
}
|
||||
|
||||
- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request handler:(id<RCTURLRequestHandler>)handler completionBlock:(RCTURLRequestCompletionBlock)completionBlock
|
||||
{
|
||||
if (!handler) {
|
||||
// specified handler is nil, fall back to generic method
|
||||
return [self networkTaskWithRequest:request completionBlock:completionBlock];
|
||||
}
|
||||
RCTNetworkTask *task = [[RCTNetworkTask alloc] initWithRequest:request
|
||||
handler:handler
|
||||
callbackQueue:_methodQueue];
|
||||
task.completionBlock = completionBlock;
|
||||
return task;
|
||||
}
|
||||
|
||||
#pragma mark - JS API
|
||||
|
||||
RCT_EXPORT_METHOD(sendRequest:(JS::NativeNetworkingIOS::SpecSendRequestQuery &)query
|
||||
|
||||
Reference in New Issue
Block a user