Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit ca01361

Browse files
committed
Merge branch 'master' into 0.9.0
2 parents 0fcdf3c + 28e4b33 commit ca01361

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/ios/RNFetchBlobNetwork.m

+14-14
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
193193
- (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
194194
{
195195
expectedBytes = [response expectedContentLength];
196-
196+
197197
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
198198
NSInteger statusCode = [(NSHTTPURLResponse *)response statusCode];
199199
NSString * respType = @"";
@@ -246,7 +246,7 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
246246
@"timeout" : @NO,
247247
@"status": [NSString stringWithFormat:@"%d", statusCode ]
248248
};
249-
249+
250250
[self.bridge.eventDispatcher
251251
sendDeviceEventWithName: EVENT_STATE_CHANGE
252252
body:respInfo
@@ -275,7 +275,7 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
275275
NSLog(@"write file error");
276276
}
277277
}
278-
278+
279279
completionHandler(NSURLSessionResponseAllow);
280280
}
281281

@@ -292,11 +292,11 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
292292
{
293293
[writeStream write:[data bytes] maxLength:[data length]];
294294
}
295-
295+
296296
if([progressTable valueForKey:taskId] == @YES)
297297
{
298298
[self.bridge.eventDispatcher
299-
sendDeviceEventWithName:EVENT_PROGRESS
299+
sendDeviceEventWithName:EVENT_PROGRESS
300300
body:@{
301301
@"taskId": taskId,
302302
@"written": [NSString stringWithFormat:@"%d", receivedBytes],
@@ -316,19 +316,19 @@ - (void) URLSession:(NSURLSession *)session didBecomeInvalidWithError:(nullable
316316

317317
- (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
318318
{
319-
319+
320320
self.error = error;
321321
NSString * errMsg = [NSNull null];
322322
NSString * respStr = [NSNull null];
323323
NSString * rnfbRespType = @"";
324-
324+
325325
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
326-
326+
327327
if(respInfo == nil)
328328
{
329329
respInfo = [NSNull null];
330330
}
331-
331+
332332
if(error != nil)
333333
{
334334
errMsg = [error localizedDescription];
@@ -353,7 +353,7 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCom
353353
// if it turns out not to be `nil` that means the response data contains valid UTF8 string,
354354
// in order to properly encode the UTF8 string, use URL encoding before BASE64 encoding.
355355
NSString * utf8 = [[NSString alloc] initWithData:respData encoding:NSUTF8StringEncoding];
356-
356+
357357
if(utf8 != nil)
358358
{
359359
rnfbRespType = RESP_TYPE_UTF8;
@@ -364,12 +364,12 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCom
364364
rnfbRespType = RESP_TYPE_BASE64;
365365
respStr = [respData base64EncodedStringWithOptions:0];
366366
}
367-
367+
368368
}
369369
}
370-
370+
371371
callback(@[ errMsg, rnfbRespType, respStr]);
372-
372+
373373
@synchronized(taskTable, uploadProgressTable, progressTable)
374374
{
375375
if([taskTable objectForKey:taskId] == nil)
@@ -379,7 +379,7 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCom
379379
[uploadProgressTable removeObjectForKey:taskId];
380380
[progressTable removeObjectForKey:taskId];
381381
}
382-
382+
383383
respData = nil;
384384
receivedBytes = 0;
385385
[session finishTasksAndInvalidate];

0 commit comments

Comments
 (0)