From 83f0f6f0a46a74e9ae476db88dceafa173a562fb Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Feb 2019 16:29:12 +0100 Subject: Only allocate a post data block when posting Change-Id: Ia50b6689bdb182888aba44faf549d17747624833 Reviewed-by: Michal Klocek --- src/core/web_contents_adapter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index d85d34eb2..fe31a5b51 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 headers = request.headers(); for (QVector::const_iterator it = headers.cbegin(); it != headers.cend(); ++it) { -- cgit v1.2.3