From fd5136254539d601b1b0d03de28bf70b8a65583c Mon Sep 17 00:00:00 2001 From: brvphoenix <30111323+brvphoenix@users.noreply.github.com> Date: Mon, 30 May 2022 13:10:29 +0800 Subject: [PATCH] Don't decompress the reply data for Qt 6.3 PR #17120. --- src/base/net/downloadhandlerimpl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/base/net/downloadhandlerimpl.cpp b/src/base/net/downloadhandlerimpl.cpp index b2de6213a..a578fa817 100644 --- a/src/base/net/downloadhandlerimpl.cpp +++ b/src/base/net/downloadhandlerimpl.cpp @@ -34,10 +34,13 @@ #include "base/3rdparty/expected.hpp" #include "base/utils/fs.h" -#include "base/utils/gzip.h" #include "base/utils/io.h" #include "base/utils/misc.h" +#if (QT_VERSION < QT_VERSION_CHECK(6, 3, 0)) +#include "base/utils/gzip.h" +#endif + const int MAX_REDIRECTIONS = 20; // the common value for web browsers namespace @@ -121,9 +124,13 @@ void DownloadHandlerImpl::processFinishedDownload() } // Success +#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) + m_result.data = m_reply->readAll(); +#else m_result.data = (m_reply->rawHeader("Content-Encoding") == "gzip") ? Utils::Gzip::decompress(m_reply->readAll()) : m_reply->readAll(); +#endif if (m_downloadRequest.saveToFile()) {