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/net/url_request_custom_job_proxy.h | |
parent | 614d6639b875f53b21eaabd2d5928b84b59af707 (diff) |
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/net/url_request_custom_job_proxy.h')
-rw-r--r-- | src/core/net/url_request_custom_job_proxy.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/net/url_request_custom_job_proxy.h b/src/core/net/url_request_custom_job_proxy.h index 3795f7f14..1f8c77da2 100644 --- a/src/core/net/url_request_custom_job_proxy.h +++ b/src/core/net/url_request_custom_job_proxy.h @@ -10,6 +10,8 @@ #include "url/gurl.h" #include "url/origin.h" #include <QtCore/QPointer> +#include <QMap> +#include <QByteArray> QT_FORWARD_DECLARE_CLASS(QIODevice) @@ -29,6 +31,7 @@ public: public: std::string m_mimeType; std::string m_charset; + QMap<QByteArray, QByteArray> m_additionalResponseHeaders; GURL m_redirect; QIODevice *m_device; int64_t m_firstBytePosition; @@ -49,7 +52,8 @@ public: // Called from URLRequestCustomJobDelegate via post: //void setReplyCharset(const std::string &); - void reply(std::string mimeType, QIODevice *device); + void reply(std::string mimeType, QIODevice *device, + QMap<QByteArray, QByteArray> additionalResponseHeaders); void redirect(GURL url); void abort(); void fail(int error); |