Skip to content

Commit cb82ba3

Browse files
author
Edward Smith
committed
Re-applied pin patch.
1 parent 0ae9fef commit cb82ba3

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

Branch-SDK/Branch-SDK/BNCConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ extern NSString * const BNC_SDK_VERSION;
1212
extern NSString * const BNC_API_BASE_URL;
1313
extern NSString * const BNC_LINK_URL;
1414
extern NSString * const BNC_API_VERSION;
15+
extern BOOL const BNC_API_PINNED;

Branch-SDK/Branch-SDK/BNCConfig.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "BNCConfig.h"
1010

1111
NSString * const BNC_API_BASE_URL = @"https://api.branch.io";
12+
BOOL const BNC_API_PINNED = YES;
1213
NSString * const BNC_API_VERSION = @"v1";
1314
NSString * const BNC_LINK_URL = @"https://bnc.lt";
1415
NSString * const BNC_SDK_VERSION = @"0.19.5";
16+

Branch-SDK/Branch-SDK/Networking/BNCNetworkService.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "BNCLog.h"
1212
#import "BNCDebug.h"
1313
#import "BNCError.h"
14+
#import "BNCConfig.h"
1415

1516
#pragma mark BNCNetworkOperation
1617

@@ -275,6 +276,11 @@ - (void) URLSession:(NSURLSession *)session
275276
}
276277
}
277278

279+
if (!BNC_API_PINNED) {
280+
trusted = YES;
281+
goto exit;
282+
}
283+
278284
exit:
279285
if (err) {
280286
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil];

Branch-SDK/Branch-SDK/Networking/BNCServerInterface.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ - (NSError*) verifyNetworkOperation:(id<BNCNetworkOperationProtocol>)operation {
591591

592592
if (!operation) {
593593
NSString *message = BNCLocalizedString(
594-
@"A network operation instance is expected to be returned by the networkOperationWithURLRequest:completion: method."
594+
@"A network operation instance is expected to be returned by the"
595+
" networkOperationWithURLRequest:completion: method."
595596
);
596597
NSError *error = [NSError branchErrorWithCode:BNCNetworkServiceInterfaceError localizedMessage:message];
597598
return error;
@@ -641,7 +642,8 @@ - (BNCServerResponse *)genericHTTPRequestSynchronous:(NSURLRequest *)request {
641642
networkOperationWithURLRequest:request.copy
642643
completion:^void (id<BNCNetworkOperationProtocol>operation) {
643644
serverResponse =
644-
[self processServerResponse:operation.response data:operation.responseData error:operation.error];
645+
[self processServerResponse:operation.response
646+
data:operation.responseData error:operation.error];
645647
[self collectInstrumentationMetricsWithOperation:operation];
646648
dispatch_semaphore_signal(semaphore);
647649
}];

0 commit comments

Comments
 (0)