From dbbf4c11713a268030b552b3063b1c2a3a397793 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 21 Oct 2019 16:09:28 +0200 Subject: Add HTTP content-type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some code only checks the http content type and not the job mimetype. Change-Id: I7a2b2f5d30c2f349f2570f0422ce415eebd0f644 Fixes: QTBUG-79319 Reviewed-by: Jüri Valdmann --- src/core/net/url_request_custom_job.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/core/net/url_request_custom_job.cpp b/src/core/net/url_request_custom_job.cpp index 0e640766f..8f0fada57 100644 --- a/src/core/net/url_request_custom_job.cpp +++ b/src/core/net/url_request_custom_job.cpp @@ -156,6 +156,12 @@ void URLRequestCustomJob::GetResponseInfo(HttpResponseInfo* info) headers += base::StringPrintf("Location: %s\n", m_redirect.spec().c_str()); } else { headers += base::StringPrintf("HTTP/1.1 %i OK\n", m_httpStatusCode); + if (m_mimeType.size() > 0) { + headers += base::StringPrintf("Content-Type: %s", m_mimeType.c_str()); + if (m_charset.size() > 0) + headers += base::StringPrintf("; charset=%s", m_charset.c_str()); + headers += "\n"; + } } if (m_corsEnabled) { std::string origin; -- cgit v1.2.3