summaryrefslogtreecommitdiffstats
path: root/src/core/net/url_request_custom_job_proxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/net/url_request_custom_job_proxy.cpp')
-rw-r--r--src/core/net/url_request_custom_job_proxy.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index b5f10388c..72d14450e 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -152,7 +152,9 @@ void URLRequestCustomJobProxy::readyRead()
m_job->notifyReadyRead();
}
-void URLRequestCustomJobProxy::initialize(GURL url, std::string method, base::Optional<url::Origin> initiator)
+void URLRequestCustomJobProxy::initialize(GURL url, std::string method,
+ base::Optional<url::Origin> initiator,
+ std::map<std::string, std::string> headers)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
Q_ASSERT(!m_delegate);
@@ -164,12 +166,16 @@ void URLRequestCustomJobProxy::initialize(GURL url, std::string method, base::Op
QWebEngineUrlSchemeHandler *schemeHandler = nullptr;
if (m_profileAdapter)
- schemeHandler = m_profileAdapter->customUrlSchemeHandlers()[toQByteArray(m_scheme)];
+ schemeHandler = m_profileAdapter->urlSchemeHandler(toQByteArray(m_scheme));
+ QMap<QByteArray, QByteArray> qHeaders;
+ for (auto it = headers.cbegin(); it != headers.cend(); ++it)
+ qHeaders.insert(toQByteArray(it->first), toQByteArray(it->second));
if (schemeHandler) {
m_delegate = new URLRequestCustomJobDelegate(this, toQt(url),
QByteArray::fromStdString(method),
- initiatorOrigin);
+ initiatorOrigin,
+ qHeaders);
QWebEngineUrlRequestJob *requestJob = new QWebEngineUrlRequestJob(m_delegate);
schemeHandler->requestStarted(requestJob);
}