Don't decompress the reply data for Qt 6.3

PR #17120.
This commit is contained in:
brvphoenix 2022-05-30 13:10:29 +08:00 committed by GitHub
parent 56b99f4e19
commit fd51362545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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())
{