HTTP source: Fix API abuse by calling completion handler as requested

CQTexperiment
Christopher Snowhill 2021-12-22 16:24:49 -08:00
parent 2bb9698e34
commit fd75e1b260
1 changed files with 2 additions and 1 deletions

View File

@ -139,7 +139,7 @@ willPerformHTTPRedirection:(NSHTTPURLResponse *)response
completionHandler:(void (^)(NSURLRequest *))completionHandler { completionHandler:(void (^)(NSURLRequest *))completionHandler {
NSURL * url = [request URL]; NSURL * url = [request URL];
if ([redirectURLs containsObject:url]) { if ([redirectURLs containsObject:url]) {
completionHandler(NULL); completionHandler(nil);
@synchronized(self->task) { @synchronized(self->task) {
self->task = nil; self->task = nil;
} }
@ -168,6 +168,7 @@ didBecomeInvalidWithError:(NSError *)error {
willCacheResponse:(NSCachedURLResponse *)proposedResponse willCacheResponse:(NSCachedURLResponse *)proposedResponse
completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler{ completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler{
didComplete = YES; didComplete = YES;
completionHandler(nil);
} }
- (void)URLSession:(NSURLSession *)session - (void)URLSession:(NSURLSession *)session