summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-04 16:29:12 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-08 10:47:17 +0000
commit83f0f6f0a46a74e9ae476db88dceafa173a562fb (patch)
treebc0bf675171686c8a229ed2e82628a052951af26
parent0f98e93d8168835a1eb0617bd8ca3988d6d83daa (diff)
Only allocate a post data block when posting
Change-Id: Ia50b6689bdb182888aba44faf549d17747624833 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--src/core/web_contents_adapter.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index d85d34eb..fe31a5b5 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -644,13 +644,12 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
"HTTP-POST data can only be sent over HTTP(S) protocol"));
return;
}
+ params.post_data = network::ResourceRequestBody::CreateFromBytes(
+ (const char*)request.postData().constData(),
+ request.postData().length());
break;
}
- params.post_data = network::ResourceRequestBody::CreateFromBytes(
- (const char*)request.postData().constData(),
- request.postData().length());
-
// convert the custom headers into the format that chromium expects
QVector<QByteArray> headers = request.headers();
for (QVector<QByteArray>::const_iterator it = headers.cbegin(); it != headers.cend(); ++it) {