Authored by Bogdan Poplauschi
Committed by GitHub

Merge pull request #1657 from mackoj/master

Add support for downloading images behind redirect
@@ -296,6 +296,11 @@ didReceiveResponse:(NSURLResponse *)response @@ -296,6 +296,11 @@ didReceiveResponse:(NSURLResponse *)response
296 [dataOperation URLSession:session task:task didCompleteWithError:error]; 296 [dataOperation URLSession:session task:task didCompleteWithError:error];
297 } 297 }
298 298
  299 +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest * _Nullable))completionHandler {
  300 +
  301 + completionHandler(request);
  302 +}
  303 +
299 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { 304 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler {
300 305
301 // Identify the operation that runs this task and pass it the delegate method 306 // Identify the operation that runs this task and pass it the delegate method