⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 269049 in webkit


Ignore:
Timestamp:
Oct 27, 2020, 10:30:14 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Use NSURLSessionAuthChallengeRejectProtectionSpace if WKNavigationDelegate didReceiveAuthenticationChallenge is not implemented
​https://bugs.webkit.org/show_bug.cgi?id=218008

Patch by Alex Christensen <​achristensen@webkit.org> on 2020-10-27
Reviewed by Darin Adler.

This is documented in WKNavigationDelegate.h, and the behavior is basically identical.
The difference is if there is a challenge with multiple protection spaces and a delegate that implements didReceiveAuthenticationChallenge
is attached between the delegate callbacks, it will receive the second callback. This is unlikely and next to impossible to test, but
out of principle we should behave like we have documented that we do.

  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r269048 r269049  
     12020-10-27  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use NSURLSessionAuthChallengeRejectProtectionSpace if WKNavigationDelegate didReceiveAuthenticationChallenge is not implemented
     4        https://bugs.webkit.org/show_bug.cgi?id=218008
     5
     6        Reviewed by Darin Adler.
     7
     8        This is documented in WKNavigationDelegate.h, and the behavior is basically identical.
     9        The difference is if there is a challenge with multiple protection spaces and a delegate that implements didReceiveAuthenticationChallenge
     10        is attached between the delegate callbacks, it will receive the second callback.  This is unlikely and next to impossible to test, but
     11        out of principle we should behave like we have documented that we do.
     12
     13        * UIProcess/Cocoa/NavigationState.mm:
     14        (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
     15
    1162020-10-27  Sam Weinig  <weinig@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r263422 r269049  
    10021002{
    10031003    if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler)
    1004         return authenticationChallenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling);
    1005 
    1006     auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
    1007     if (!navigationDelegate)
    1008         return authenticationChallenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling);
     1004        return authenticationChallenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue);
     1005
     1006    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
     1007    if (!navigationDelegate)
     1008        return authenticationChallenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue);
    10091009
    10101010    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:didReceiveAuthenticationChallenge:completionHandler:));
Note: See TracChangeset for help on using the changeset viewer.