summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-21 16:09:28 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-23 08:58:37 +0200
commitdbbf4c11713a268030b552b3063b1c2a3a397793 (patch)
treeaa974a5bebbf20cb3fd5da4e4783616c3a59e495 /src/core
parent229621361562d0e89aeb5f2d2f0ace0115bf164c (diff)
Add HTTP content-type
Some code only checks the http content type and not the job mimetype. Change-Id: I7a2b2f5d30c2f349f2570f0422ce415eebd0f644 Fixes: QTBUG-79319 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/net/url_request_custom_job.cpp6
1 files changed, 6 insertions, 0 deletions
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;