From caa9551ae422a01c53d890a219f620954b6f6764 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Sat, 9 Feb 2013 19:36:37 +0100 Subject: [PATCH] [Issue #791] Matching operations on request URL path rather than absolute URL string --- AFNetworking/AFHTTPClient.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index e2fd452..8f49be3 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -546,7 +546,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { - (void)cancelAllHTTPOperationsWithMethod:(NSString *)method path:(NSString *)path { - NSString *URLStringToMatched = [[[self requestWithMethod:(method ?: @"GET") path:path parameters:nil] URL] absoluteString]; + NSString *pathToBeMatched = [[[self requestWithMethod:(method ?: @"GET") path:path parameters:nil] URL] path]; for (NSOperation *operation in [self.operationQueue operations]) { if (![operation isKindOfClass:[AFHTTPRequestOperation class]]) { @@ -554,9 +554,9 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { } BOOL hasMatchingMethod = !method || [method isEqualToString:[[(AFHTTPRequestOperation *)operation request] HTTPMethod]]; - BOOL hasMatchingURL = [[[[(AFHTTPRequestOperation *)operation request] URL] absoluteString] isEqualToString:URLStringToMatched]; + BOOL hasMatchingPath = [[[[(AFHTTPRequestOperation *)operation request] URL] path] isEqual:pathToBeMatched]; - if (hasMatchingMethod && hasMatchingURL) { + if (hasMatchingMethod && hasMatchingPath) { [operation cancel]; } }