diff options
author | Yigit Akcay <yigit.akcay@qt.io> | 2023-01-08 01:41:00 +0100 |
---|---|---|
committer | Yigit Akcay <yigit.akcay@qt.io> | 2023-01-26 16:54:42 +0100 |
commit | dc7a726e431bdeb11449093a002a2b6daea0f67b (patch) | |
tree | 3959b302af7b184cbb64ca482b267cc6990d3071 /src/core/api/qwebengineurlrequestjob.cpp | |
parent | 614d6639b875f53b21eaabd2d5928b84b59af707 (diff) | |
download | qtwebengine-dc7a726e431bdeb11449093a002a2b6daea0f67b.tar.gz |
QWebEngineUrlRequestJob: Add function to set additional reponse headers
Add additional response headers field to URLRequestCustomJobDelegate.
Those fields can be set via
QWebEngineUrlRequestJob::setAdditionalResponseHeaders(
const QMap<QByteArray, QByteArray> &
). They are added to URLRequestCustomJobProxy::m_client when
URLRequestCustomJobProxy::reply(std::string, QIODevice) is called, and
added to the response headers within
CustomURLLoaderFactory::notifyHeadersComplete().
Fixes: QTBUG-106578
Change-Id: Ie0f0af07a5381c6f24ec0a1ee1b5bcb0e8c4fa5f
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/api/qwebengineurlrequestjob.cpp')
-rw-r--r-- | src/core/api/qwebengineurlrequestjob.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp index 6c0adfddf..099efef8e 100644 --- a/src/core/api/qwebengineurlrequestjob.cpp +++ b/src/core/api/qwebengineurlrequestjob.cpp @@ -112,6 +112,18 @@ QMap<QByteArray, QByteArray> QWebEngineUrlRequestJob::requestHeaders() const } /*! + \since 6.6 + Set \a additionalResponseHeaders. These additional headers of the response + are only used when QWebEngineUrlRequestJob::reply(const QByteArray&, QIODevice*) + is called. +*/ +void QWebEngineUrlRequestJob::setAdditionalResponseHeaders( + const QMap<QByteArray, QByteArray> &additionalResponseHeaders) const +{ + d_ptr->setAdditionalResponseHeaders(additionalResponseHeaders); +} + +/*! Replies to the request with \a device and the content type \a contentType. Content type is similar to the HTTP Content-Type header, and can either be a MIME type, or a MIME type and charset encoding combined like this: |