From 65537c4983aa3ff92cdf24978b440d66275efbbd Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 25 Apr 2018 14:21:38 +0800 Subject: [PATCH] Remove the check for URLProtocol in custom loader to avoid crash on iOS 8. Let URLSession itself or download operation to parse the result. --- SDWebImage/SDWebImageDownloader.m | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index f42568c2..1221bb63 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -469,23 +469,7 @@ didReceiveResponse:(NSURLResponse *)response if (!url) { return NO; } - Class operationClass = self.config.operationClass; - if (!operationClass || [operationClass isSubclassOfClass:[SDWebImageDownloaderOperation class]]) { - // Built-in download operation class, checking all supported NSURLProtocol - NSURLRequest *request = [NSURLRequest requestWithURL:url]; - NSArray *protocolClasses = self.sessionConfiguration.protocolClasses; - for (Class protocolClass in protocolClasses) { - if ([protocolClass isSubclassOfClass:[NSURLProtocol class]]) { - BOOL canLoad = [protocolClass canInitWithRequest:request]; - if (canLoad) { - return YES; - } - continue; - } - } - return NO; - } - // Custom download operation class may not dependent on NSURLSession, always pass YES. + // Always pass YES to let URLSession or custom download operation to determine return YES; }