Merge pull request #2123 from realaboo/master
Allow custom SDWebImageDownloaderOperation to handle HTTP redirect
This commit is contained in:
commit
d854d60095
|
@ -327,7 +327,12 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
|
||||
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest * _Nullable))completionHandler {
|
||||
|
||||
completionHandler(request);
|
||||
SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:task];
|
||||
if ([dataOperation respondsToSelector:@selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)]) {
|
||||
[dataOperation URLSession:session task:task willPerformHTTPRedirection:response newRequest:request completionHandler:completionHandler];
|
||||
} else {
|
||||
completionHandler(request);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler {
|
||||
|
|
Loading…
Reference in New Issue