summaryrefslogtreecommitdiffstats
path: root/src/core/login_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-21 14:35:01 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-21 14:35:01 +0100
commit432af50e930b7f11455fc1daec17d9c215ea88ee (patch)
tree75f8e9cc04069de32c25660298c4fce046f88b4e /src/core/login_delegate_qt.cpp
parent809afc26fe0c47b249cf11376c8ea484a2bfaaf1 (diff)
parentd5a479a720ee76fae9fa7b0f7b6b3d0a61718ff0 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/core/login_delegate_qt.cpp')
-rw-r--r--src/core/login_delegate_qt.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp
index 5b407c094..0050f87c7 100644
--- a/src/core/login_delegate_qt.cpp
+++ b/src/core/login_delegate_qt.cpp
@@ -68,6 +68,7 @@
#include "resource_context_qt.h"
#include "type_conversion.h"
#include "web_contents_view_qt.h"
+#include "web_engine_context.h"
namespace QtWebEngineCore {
@@ -118,6 +119,11 @@ QString LoginDelegateQt::host() const
return QString::fromStdString(m_authInfo->challenger.host());
}
+int LoginDelegateQt::port() const
+{
+ return m_authInfo->challenger.port();
+}
+
bool LoginDelegateQt::isProxy() const
{
return m_authInfo->is_proxy;
@@ -126,6 +132,19 @@ bool LoginDelegateQt::isProxy() const
void LoginDelegateQt::triggerDialogOnUI()
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ if (isProxy()) {
+ // workaround for 'ws' redefined symbols when including QNetworkProxy
+ auto authentication = WebEngineContext::qProxyNetworkAuthentication(host(), port());
+ if (std::get<0>(authentication)) {
+ base::PostTaskWithTraits(
+ FROM_HERE, { content::BrowserThread::IO },
+ base::BindOnce(&LoginDelegateQt::sendAuthToRequester, this, true,
+ std::get<1>(authentication), std::get<2>(authentication)));
+
+ return;
+ }
+ }
content::WebContentsImpl *webContents =
static_cast<content::WebContentsImpl *>(m_webContentsGetter.Run());
if (!webContents)