Revision: 23999
          http://sourceforge.net/p/bibdesk/svn/23999
Author:   hofman
Date:     2019-07-11 14:14:17 +0000 (Thu, 11 Jul 2019)
Log Message:
-----------
use default handling for session wide authen tication challenges, to avoid 
getting them in the task delegate method

Modified Paths:
--------------
    trunk/bibdesk/BDSKDownloaderSession.m

Modified: trunk/bibdesk/BDSKDownloaderSession.m
===================================================================
--- trunk/bibdesk/BDSKDownloaderSession.m       2019-07-11 13:48:18 UTC (rev 
23998)
+++ trunk/bibdesk/BDSKDownloaderSession.m       2019-07-11 14:14:17 UTC (rev 
23999)
@@ -177,7 +177,7 @@
 
 #pragma mark NSURLSessionTaskDelegate
 
-- (void)URLSession:(NSURLSession *)aSession task:(NSURLSessionTask *)task 
didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge 
completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, 
NSURLCredential * _Nullable credential))completionHandler {
+- (void)URLSession:(NSURLSession *)aSession task:(NSURLSessionTask *)task 
didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge 
completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, 
NSURLCredential *credential))completionHandler {
     BDSKDownload *download = [[[self downloadForTask:task] retain] 
autorelease];
     [self _download:download didReceiveChallenge:challenge 
completionHandler:(void (^)(BDSKDownloaderAuthChallengeDisposition disposition, 
NSURLCredential *credential))completionHandler];
 }
@@ -192,4 +192,11 @@
     [self cleanupDownload:download];
 }
 
+#pragma mark NSURLSessionDelegate
+
+// we need to implement this to avoid it being forwarded to the task specific 
delegate method
+- (void)URLSession:(NSURLSession *)aSession 
didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge 
completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, 
NSURLCredential *credential))completionHandler {
+    completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
+}
+
 @end

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to