QDecompressHelper: Change order of encodings

Before the introduction of QDecompressHelper gzip was preferred over
deflate. The change seems to be accidental. Amends commit
7b76379a89.

Change-Id: I70f33d551912465d63f49ea3db1ac3575d19a92d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Ulf Hermann 2020-08-12 09:53:16 +02:00
parent 4db44bc32f
commit 3e25d09b08
2 changed files with 3 additions and 1 deletions

View File

@ -59,8 +59,8 @@ struct ContentEncodingMapping
};
constexpr ContentEncodingMapping contentEncodingMapping[] {
{ "deflate", QDecompressHelper::Deflate },
{ "gzip", QDecompressHelper::GZip },
{ "deflate", QDecompressHelper::Deflate },
#if QT_CONFIG(brotli)
{ "br", QDecompressHelper::Brotli },
#endif

View File

@ -90,6 +90,8 @@ void tst_QDecompressHelper::encodingSupported()
QVERIFY(accepted.contains("gzip"));
int expected = 2;
QVERIFY(accepted.indexOf("gzip") < accepted.indexOf("deflate"));
#if QT_CONFIG(brotli)
QVERIFY(QDecompressHelper::isSupportedEncoding("br"));
QVERIFY(accepted.contains("br"));