Changeset 242092 in webkit


Ignore:
Timestamp:
Feb 26, 2019 10:24:41 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
https://bugs.webkit.org/show_bug.cgi?id=191652

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-02-26
Reviewed by Alex Christensen.

Source/WebKit:

Test: http/tests/security/401-logout/401-logout.php

  • NetworkProcess/curl/NetworkDataTaskCurl.cpp:

(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):

  • NetworkProcess/curl/NetworkDataTaskCurl.h:

Tools:

Fix WinCairo MiniBrowser behavior of authentication dialog.

  • MiniBrowser/win/WebKitBrowserWindow.cpp:

(WebKitBrowserWindow::didReceiveAuthenticationChallenge):

LayoutTests:

Added appropriate expected results for WebKit/WebKitLegacy of WinCairo port.

  • platform/wincairo-wk1/http/tests/security/401-logout/401-logout-expected.txt: Added.
  • platform/wincairo/TestExpectations:
  • platform/wincairo/http/tests/security/401-logout/401-logout-expected.txt: Added.
Location:
trunk
Files:
8 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r242090 r242092  
     12019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
     4        https://bugs.webkit.org/show_bug.cgi?id=191652
     5
     6        Reviewed by Alex Christensen.
     7
     8        Added appropriate expected results for WebKit/WebKitLegacy of WinCairo port.
     9
     10        * platform/wincairo-wk1/http/tests/security/401-logout/401-logout-expected.txt: Added.
     11        * platform/wincairo/TestExpectations:
     12        * platform/wincairo/http/tests/security/401-logout/401-logout-expected.txt: Added.
     13
    1142019-02-26  Frederic Wang  <fwang@igalia.com>
    215
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r241979 r242092  
    931931http/tests/preload [ Skip ]
    932932http/tests/quicklook [ Skip ]
     933
    933934http/tests/security [ Skip ]
     935http/tests/security/401-logout/401-logout.php [ Pass ]
     936
    934937http/tests/ssl [ Skip ]
    935938
  • trunk/Source/WebKit/ChangeLog

    r242089 r242092  
     12019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
     4        https://bugs.webkit.org/show_bug.cgi?id=191652
     5
     6        Reviewed by Alex Christensen.
     7
     8        Test: http/tests/security/401-logout/401-logout.php
     9
     10        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
     11        (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
     12        (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
     13        * NetworkProcess/curl/NetworkDataTaskCurl.h:
     14
    1152019-02-26  Youenn Fablet  <youenn@apple.com>
    216
  • trunk/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp

    r241317 r242092  
    360360        }
    361361
    362         if (disposition == AuthenticationChallengeDisposition::UseCredential && (!credential.isEmpty() || !m_didChallengeEmptyCredentialForAuth)) {
    363             // When "isAllowedToAskUserForCredentials" is false, an empty credential, which might cause
    364             // an infinite authentication loop. To avoid such infinite loop, a HTTP authentication with empty
    365             // user and password is processed only once.
    366             if (credential.isEmpty())
    367                 m_didChallengeEmptyCredentialForAuth = true;
    368 
     362        if (disposition == AuthenticationChallengeDisposition::UseCredential && !credential.isEmpty()) {
    369363            if (m_storedCredentialsPolicy == StoredCredentialsPolicy::Use) {
    370364                if (credential.persistence() == CredentialPersistenceForSession || credential.persistence() == CredentialPersistencePermanent)
     
    392386        }
    393387
    394         if (disposition == AuthenticationChallengeDisposition::UseCredential && (!credential.isEmpty() || !m_didChallengeEmptyCredentialForProxyAuth)) {
    395             if (credential.isEmpty())
    396                 m_didChallengeEmptyCredentialForProxyAuth = true;
    397 
     388        if (disposition == AuthenticationChallengeDisposition::UseCredential && !credential.isEmpty()) {
    398389            CurlContext::singleton().setProxyUserPass(credential.user(), credential.password());
    399390            CurlContext::singleton().setDefaultProxyAuthMethod();
  • trunk/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h

    r241317 r242092  
    8888    unsigned m_redirectCount { 0 };
    8989    unsigned m_authFailureCount { 0 };
    90     bool m_didChallengeEmptyCredentialForAuth { false };
    91     bool m_didChallengeEmptyCredentialForProxyAuth { false };
    9290    MonotonicTime m_startTime;
    9391};
  • trunk/Tools/ChangeLog

    r242089 r242092  
     12019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
     4        https://bugs.webkit.org/show_bug.cgi?id=191652
     5
     6        Reviewed by Alex Christensen.
     7
     8        Fix WinCairo MiniBrowser behavior of authentication dialog.
     9
     10        * MiniBrowser/win/WebKitBrowserWindow.cpp:
     11        (WebKitBrowserWindow::didReceiveAuthenticationChallenge):
     12
    1132019-02-26  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp

    r239666 r242092  
    290290    }
    291291
    292     WKAuthenticationDecisionListenerCancel(decisionListener);
    293 }
     292    WKAuthenticationDecisionListenerUseCredential(decisionListener, nullptr);
     293}
Note: See TracChangeset for help on using the changeset viewer.