Fix HTTP compression precedence (#6331)

There is a bug in the deflate compression. Therefore, we do not want
to select this in the default choice for HTTP response compression.
Instead we revert back to the previous precedence, selecting gzip as
the priority.
This commit is contained in:
Michael Bell
2022-08-25 17:49:35 +01:00
committed by GitHub
parent df3c553f4f
commit c204360aa0
2 changed files with 5 additions and 4 deletions
+4 -4
View File
@@ -27,14 +27,14 @@ http::compression_type select_compression(const boost::beast::http::fields &fiel
{
const auto header_value = fields[boost::beast::http::field::accept_encoding];
/* giving gzip precedence over deflate */
if (boost::icontains(header_value, "deflate"))
{
return http::deflate_rfc1951;
}
if (boost::icontains(header_value, "gzip"))
{
return http::gzip_rfc1952;
}
if (boost::icontains(header_value, "deflate"))
{
return http::deflate_rfc1951;
}
return http::no_compression;
}