From 8d4795f42fa511311c066fbec82ec1bb8339860a Mon Sep 17 00:00:00 2001 From: John Szumski Date: Fri, 6 Oct 2023 11:56:55 -0400 Subject: [PATCH] Fixes case where `URLSession:dataTask:didReceiveResponse:` could sometimes return before calling its completion handler --- Sources/SBTUITestTunnelServer/private/SBTProxyURLProtocol.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sources/SBTUITestTunnelServer/private/SBTProxyURLProtocol.m b/Sources/SBTUITestTunnelServer/private/SBTProxyURLProtocol.m index 4b265247..603a12c8 100644 --- a/Sources/SBTUITestTunnelServer/private/SBTProxyURLProtocol.m +++ b/Sources/SBTUITestTunnelServer/private/SBTProxyURLProtocol.m @@ -672,8 +672,6 @@ -(void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataT [self.client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; [self.client URLProtocol:self didLoadData:stubResponse.data]; [self.client URLProtocolDidFinishLoading:self]; - - return; } else { [self.client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; }