WebKit Bugzilla
Attachment 348189 Details for
Bug 188998
: [Curl] Enable Proxy Authentication on WebKit.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
PATCH
188998.diff (text/plain), 4.66 KB, created by
Basuke Suzuki
on 2018-08-27 12:57:12 PDT
(
hide
)
Description:
PATCH
Filename:
MIME Type:
Creator:
Basuke Suzuki
Created:
2018-08-27 12:57:12 PDT
Size:
4.66 KB
patch
obsolete
>diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f6b8722228a..4198f828380 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2018-08-27 Basuke Suzuki <Basuke.Suzuki@sony.com> >+ >+ [Curl] Enable Proxy Authentication on WebKit. >+ https://bugs.webkit.org/show_bug.cgi?id=188998 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for proxy authentication to curl backend running on WebKit. >+ This is follow up implementation of legacy implementation: >+ - https://bugs.webkit.org/show_bug.cgi?id=185266 >+ >+ * NetworkProcess/curl/NetworkDataTaskCurl.cpp: >+ (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse): >+ (WebKit::NetworkDataTaskCurl::tryProxyAuthentication): >+ * NetworkProcess/curl/NetworkDataTaskCurl.h: >+ * NetworkProcess/curl/NetworkProcessCurl.cpp: >+ * PlatformWin.cmake: >+ > 2018-08-24 Basuke Suzuki <Basuke.Suzuki@sony.com> > > [Curl] Match the interface used in NetworkDataTask and ResourceHandle. >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >index b0623e3733d..29b528e1c79 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >@@ -169,6 +169,11 @@ void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest& request, const Cur > return; > } > >+ if (m_response.isProxyAuthenticationRequired()) { >+ tryProxyAuthentication(AuthenticationChallenge(receivedResponse, 0, m_response)); >+ return; >+ } >+ > didReceiveResponse(ResourceResponse(m_response), [this, protectedThis = makeRef(*this)](PolicyAction policyAction) { > if (m_state == State::Canceling || m_state == State::Completed) > return; >@@ -360,6 +365,26 @@ void NetworkDataTaskCurl::tryHttpAuthentication(AuthenticationChallenge&& challe > }); > } > >+void NetworkDataTaskCurl::tryProxyAuthentication(WebCore::AuthenticationChallenge&& challenge) >+{ >+ m_client->didReceiveChallenge(AuthenticationChallenge(challenge), [this, protectedThis = makeRef(*this), challenge](AuthenticationChallengeDisposition disposition, const Credential& credential) { >+ if (m_state == State::Canceling || m_state == State::Completed) >+ return; >+ >+ if (disposition == AuthenticationChallengeDisposition::Cancel) { >+ cancel(); >+ m_client->didCompleteWithError(ResourceError::httpError(CURLE_COULDNT_RESOLVE_PROXY, m_response.url())); >+ return; >+ } >+ >+ CurlContext::singleton().setProxyUserPass(credential.user(), credential.password()); >+ CurlContext::singleton().setDefaultProxyAuthMethod(); >+ >+ auto requestCredential = m_curlRequest ? Credential(m_curlRequest->user(), m_curlRequest->password(), CredentialPersistenceNone) : Credential(); >+ restartWithCredential(requestCredential); >+ }); >+} >+ > void NetworkDataTaskCurl::restartWithCredential(const Credential& credential) > { > if (m_curlRequest) >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h >index d955f9a0836..1fd3d0270fd 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h >+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h >@@ -73,6 +73,7 @@ private: > void willPerformHTTPRedirection(); > > void tryHttpAuthentication(WebCore::AuthenticationChallenge&&); >+ void tryProxyAuthentication(WebCore::AuthenticationChallenge&&); > void restartWithCredential(const WebCore::Credential&); > > void appendCookieHeader(WebCore::ResourceRequest&); >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp >index b046a9b0ae1..19131c67322 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkProcessCurl.cpp >@@ -33,6 +33,8 @@ > #include <WebCore/CertificateInfo.h> > #include <WebCore/FileSystem.h> > #include <WebCore/NetworkStorageSession.h> >+#include "WebCookieManager.h" >+#include <WebCore/CurlContext.h> > #include <WebCore/NotImplemented.h> > #include <WebCore/ResourceHandle.h> > #include <wtf/RAMSize.h> >diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake >index 0be7e266c39..5c99d5aa5a7 100644 >--- a/Source/WebKit/PlatformWin.cmake >+++ b/Source/WebKit/PlatformWin.cmake >@@ -176,6 +176,7 @@ if (${WTF_PLATFORM_WIN_CAIRO}) > ) > > list(APPEND WebKit_INCLUDE_DIRECTORIES >+ "${WEBCORE_DIR}/platform/network/curl" > "${WEBKIT_DIR}/NetworkProcess/curl" > "${WEBKIT_DIR}/WebProcess/WebCoreSupport/curl" > )
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188998
:
348184
| 348189