diff options
author | Anu Aliyas <anu.aliyas@qt.io> | 2023-05-04 10:48:18 +0200 |
---|---|---|
committer | Anu Aliyas <anu.aliyas@qt.io> | 2023-05-11 09:52:29 +0200 |
commit | d1b7b72d8388c5e74b6612be1574e958fe800488 (patch) | |
tree | 8b92c566216a58b985275023cee728b76315e569 | |
parent | 7b69f3728ace534bfb933e9ae196bff0e2394344 (diff) | |
download | qtwebengine-d1b7b72d8388c5e74b6612be1574e958fe800488.tar.gz |
Remove unwanted space characters from content-type and character set
- Removed leading and trailing space characters from content-type and character set.
Fixes: QTBUG-112483
Change-Id: I7616ba7aa78e4d76121e8beb17f32f898e3734a6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/core/net/url_request_custom_job_proxy.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp index d7adcc7e8..d548055b5 100644 --- a/src/core/net/url_request_custom_job_proxy.cpp +++ b/src/core/net/url_request_custom_job_proxy.cpp @@ -51,13 +51,13 @@ void URLRequestCustomJobProxy::reply(std::string contentType, QIODevice *device, if (sidx > 0) { const int cidx = qcontentType.indexOf("charset=", sidx); if (cidx > 0) { - m_client->m_charset = qcontentType.mid(cidx + 8).toStdString(); + m_client->m_charset = qcontentType.mid(cidx + 8).trimmed().toStdString(); qcontentType = qcontentType.first(sidx); } else { qWarning() << "QWebEngineUrlRequestJob::reply(): Unrecognized content-type format with ';'" << qcontentType; } } - m_client->m_mimeType = qcontentType.toStdString(); + m_client->m_mimeType = qcontentType.trimmed().toStdString(); m_client->m_device = device; m_client->m_additionalResponseHeaders = additionalResponseHeaders; if (m_client->m_device && !m_client->m_device->isReadable()) |