From 45c05caaa9799a64c9d64988ad035f329dd5c5e0 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Sun, 24 Mar 2013 02:09:08 -0400 Subject: [PATCH] Renaming defaultPinMode -> defaultPinningMode, to match AFURLConnectionOperation Moving setting of pinning mode to creation of operation rather than -enqueueHTTPRequestOperation --- AFNetworking/AFHTTPClient.h | 2 +- AFNetworking/AFHTTPClient.m | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/AFNetworking/AFHTTPClient.h b/AFNetworking/AFHTTPClient.h index 398bb10..4c27c93 100644 --- a/AFNetworking/AFHTTPClient.h +++ b/AFNetworking/AFHTTPClient.h @@ -142,7 +142,7 @@ typedef enum { Default SSL pinning mode for each `AFHTTPRequestOperation` which will be enqueued with `enqueueHTTPRequestOperation:`. */ #ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_ -@property (nonatomic, assign) AFURLConnectionOperationSSLPinningMode defaultSSLPinMode; +@property (nonatomic, assign) AFURLConnectionOperationSSLPinningMode defaultSSLPinningMode; #endif ///--------------------------------------------- diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index d4c4042..88ec1cb 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -533,6 +533,9 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { [operation setCompletionBlockWithSuccess:success failure:failure]; operation.credential = self.defaultCredential; +#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_ + operation.SSLPinningMode = self.defaultSSLPinningMode; +#endif return operation; } @@ -540,10 +543,6 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { #pragma mark - - (void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation { -#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_ - operation.SSLPinningMode = self.defaultSSLPinMode; -#endif - [self.operationQueue addOperation:operation]; }