     ///                        version of that response, or NULL to prevent caching the response. If your delegate implements this method, 
     ///                        it must call this completion handler; otherwise, your app leaks memory.
     public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Swift.Void) {
-        dataTaskOfSessionWillCacheResponse?(dataTask, session, proposedResponse, completionHandler)
+        if let willCacheResponse = dataTaskOfSessionWillCacheResponse {
+            willCacheResponse(dataTask, session, proposedResponse, completionHandler)
+            return
+        }
+        
+        completionHandler(proposedResponse)
     }
 }
 

        
        // Performing default handling without credential.
        completionHandler(.performDefaultHandling, nil)
        
        let protectionSpace = challenge.protectionSpace
        let proposedCredential = challenge.proposedCredential
        let failureResponse = challenge.failureResponse
        let error = challenge.error
        let sender = challenge.sender
    }
}


    ///                        - If you pass becomeDownload as the disposition, your delegate’s urlSession(_:dataTask:didBecome:)
    ///                          method is called to provide you with the new download task that supersedes the current task.
    public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Swift.Void) {
        if let didReceiveResponse = dataTaskOfSessionDidReceiveResponse {
            didReceiveResponse(dataTask, session, response, completionHandler)
            return
        }
        
        completionHandler(.allow)
    }
    /// Tells the delegate that the data task was changed to a download task.
    /// When the delegate’s URLSession:dataTask:didReceiveResponse:completionHandler: method decides to change the disposition from a data request to a download, the session calls this delegate method to provide you with the new download task. After this call, the session delegate receives no further delegate method calls related to the original data task.
