Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions ios/IOS7Polyfill.h

This file was deleted.

2 changes: 0 additions & 2 deletions ios/RNFetchBlob.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
A19B48241D98102400E6868A /* RNFetchBlobProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFetchBlobProgress.m; sourceTree = "<group>"; };
A1AAE2971D300E3E0051D11C /* RNFetchBlobReqBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFetchBlobReqBuilder.h; sourceTree = "<group>"; };
A1AAE2981D300E4D0051D11C /* RNFetchBlobReqBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFetchBlobReqBuilder.m; sourceTree = "<group>"; };
A1F950181D7E9134002A95A6 /* IOS7Polyfill.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IOS7Polyfill.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -71,7 +70,6 @@
children = (
A19B48241D98102400E6868A /* RNFetchBlobProgress.m */,
A19B48231D98100800E6868A /* RNFetchBlobProgress.h */,
A1F950181D7E9134002A95A6 /* IOS7Polyfill.h */,
A1AAE2981D300E4D0051D11C /* RNFetchBlobReqBuilder.m */,
A1AAE2971D300E3E0051D11C /* RNFetchBlobReqBuilder.h */,
A158F42E1D0539CE006FFD38 /* RNFetchBlobNetwork.h */,
Expand Down
3 changes: 1 addition & 2 deletions ios/RNFetchBlobFS.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "RNFetchBlob.h"
#import "RNFetchBlobFS.h"
#import "RNFetchBlobConst.h"
#import "IOS7Polyfill.h"
@import AssetsLibrary;

#import <CommonCrypto/CommonDigest.h>
Expand Down Expand Up @@ -375,7 +374,7 @@ + (void) writeFile:(NSString *)path

NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:path];
NSData * content = nil;
if([encoding RNFBContainsString:@"base64"]) {
if([encoding containsString:@"base64"]) {
content = [[NSData alloc] initWithBase64EncodedString:data options:0];
}
else if([encoding isEqualToString:@"uri"]) {
Expand Down
7 changes: 3 additions & 4 deletions ios/RNFetchBlobReqBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#import "RNFetchBlobNetwork.h"
#import "RNFetchBlobConst.h"
#import "RNFetchBlobFS.h"
#import "IOS7Polyfill.h"

#if __has_include(<React/RCTAssert.h>)
#import <React/RCTLog.h>
Expand Down Expand Up @@ -117,7 +116,7 @@ +(void) buildOctetRequest:(NSDictionary *)options
orgPath = [RNFetchBlobFS getPathOfAsset:orgPath];
if([orgPath hasPrefix:AL_PREFIX])
{

[RNFetchBlobFS readFile:orgPath encoding:nil onComplete:^(id content, NSString* code, NSString * err) {
if(err != nil)
{
Expand All @@ -131,7 +130,7 @@ +(void) buildOctetRequest:(NSDictionary *)options
onComplete(request, [((NSData *)content) length]);
}
}];

return;
}
size = [[[NSFileManager defaultManager] attributesOfItemAtPath:orgPath error:nil] fileSize];
Expand All @@ -150,7 +149,7 @@ +(void) buildOctetRequest:(NSDictionary *)options

__block NSString * cType = [[self class]getHeaderIgnoreCases:@"content-type" fromHeaders:mheaders];
// when content-type is application/octet* decode body string using BASE64 decoder
if([[cType lowercaseString] hasPrefix:@"application/octet"] || [[cType lowercaseString] RNFBContainsString:@";base64"])
if([[cType lowercaseString] hasPrefix:@"application/octet"] || [[cType lowercaseString] containsString:@";base64"])
{
__block NSString * ncType = [[cType stringByReplacingOccurrencesOfString:@";base64" withString:@""]stringByReplacingOccurrencesOfString:@";BASE64" withString:@""];
if([mheaders valueForKey:@"content-type"] != nil)
Expand Down
11 changes: 5 additions & 6 deletions ios/RNFetchBlobRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import "RNFetchBlobConst.h"
#import "RNFetchBlobReqBuilder.h"

#import "IOS7Polyfill.h"
#import <CommonCrypto/CommonDigest.h>


Expand Down Expand Up @@ -214,20 +213,20 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat

return;
} else {
self.isServerPush = [[respCType lowercaseString] RNFBContainsString:@"multipart/x-mixed-replace;"];
self.isServerPush = [[respCType lowercaseString] containsString:@"multipart/x-mixed-replace;"];
}

if(respCType)
{
NSArray * extraBlobCTypes = [options objectForKey:CONFIG_EXTRA_BLOB_CTYPE];

if ([respCType RNFBContainsString:@"text/"]) {
if ([respCType containsString:@"text/"]) {
respType = @"text";
} else if ([respCType RNFBContainsString:@"application/json"]) {
} else if ([respCType containsString:@"application/json"]) {
respType = @"json";
} else if(extraBlobCTypes) { // If extra blob content type is not empty, check if response type matches
for (NSString * substr in extraBlobCTypes) {
if ([respCType RNFBContainsString:[substr lowercaseString]]) {
if ([respCType containsString:[substr lowercaseString]]) {
respType = @"blob";
respFile = YES;
destPath = [RNFetchBlobFS getTempPath:taskId withExtension:nil];
Expand Down Expand Up @@ -285,7 +284,7 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat

// if not set overwrite in options, defaults to TRUE
BOOL overwrite = [options valueForKey:@"overwrite"] == nil ? YES : [[options valueForKey:@"overwrite"] boolValue];
BOOL appendToExistingFile = [destPath RNFBContainsString:@"?append=true"];
BOOL appendToExistingFile = [destPath containsString:@"?append=true"];

appendToExistingFile = !overwrite;

Expand Down