|
17 | 17 | #import <React/RCTUtils.h>
|
18 | 18 |
|
19 | 19 | #import <React/RCTHTTPRequestHandler.h>
|
20 |
| -#import <React/RCTFileRequestHandler.h> |
21 | 20 |
|
22 | 21 | #import "RCTNetworkPlugins.h"
|
23 | 22 |
|
@@ -394,9 +393,9 @@ - (RCTURLRequestCancellationBlock)processDataForHTTPQuery:(nullable NSDictionary
|
394 | 393 | }
|
395 | 394 | NSURLRequest *request = [RCTConvert NSURLRequest:query[@"uri"]];
|
396 | 395 | if (request) {
|
| 396 | + |
397 | 397 | __block RCTURLRequestCancellationBlock cancellationBlock = nil;
|
398 |
| - id<RCTURLRequestHandler> handler = [self.moduleRegistry moduleForName:"FileRequestHandler"]; |
399 |
| - RCTNetworkTask *task = [self networkTaskWithRequest:request handler:handler completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) { |
| 398 | + RCTNetworkTask *task = [self networkTaskWithRequest:request completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) { |
400 | 399 | dispatch_async(self->_methodQueue, ^{
|
401 | 400 | cancellationBlock = callback(error, data ? @{@"body": data, @"contentType": RCTNullIfNil(response.MIMEType)} : nil);
|
402 | 401 | });
|
@@ -677,19 +676,6 @@ - (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request completionBlo
|
677 | 676 | return task;
|
678 | 677 | }
|
679 | 678 |
|
680 |
| -- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request handler:(id<RCTURLRequestHandler>)handler completionBlock:(RCTURLRequestCompletionBlock)completionBlock |
681 |
| -{ |
682 |
| - if (!handler) { |
683 |
| - // specified handler is nil, fall back to generic method |
684 |
| - return [self networkTaskWithRequest:request completionBlock:completionBlock]; |
685 |
| - } |
686 |
| - RCTNetworkTask *task = [[RCTNetworkTask alloc] initWithRequest:request |
687 |
| - handler:handler |
688 |
| - callbackQueue:_methodQueue]; |
689 |
| - task.completionBlock = completionBlock; |
690 |
| - return task; |
691 |
| -} |
692 |
| - |
693 | 679 | #pragma mark - JS API
|
694 | 680 |
|
695 | 681 | RCT_EXPORT_METHOD(sendRequest:(JS::NativeNetworkingIOS::SpecSendRequestQuery &)query
|
|
0 commit comments