[Issue #791] Matching operations on request URL path rather than absolute URL string
This commit is contained in:
parent
2cd283421f
commit
caa9551ae4
1 changed files with 3 additions and 3 deletions
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue