Skip to content

Commit c204360

Browse files
authored
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.
1 parent df3c553 commit c204360

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- CHANGED: Add `data_version` field to responses of all services. [#5387](https://github.com/Project-OSRM/osrm-backend/pull/5387)
55
- FIXED: Use Boost.Beast to parse HTTP request. [#6294](https://github.com/Project-OSRM/osrm-backend/pull/6294)
66
- FIXED: Fix inefficient osrm-routed connection handling [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113)
7+
- FIXED: Fix HTTP compression precedence [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113)
78
- NodeJS:
89
- FIXED: Support `skip_waypoints` in Node bindings [#6060](https://github.com/Project-OSRM/osrm-backend/pull/6060)
910
- Misc:

src/server/connection.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ http::compression_type select_compression(const boost::beast::http::fields &fiel
2727
{
2828
const auto header_value = fields[boost::beast::http::field::accept_encoding];
2929
/* giving gzip precedence over deflate */
30-
if (boost::icontains(header_value, "deflate"))
31-
{
32-
return http::deflate_rfc1951;
33-
}
3430
if (boost::icontains(header_value, "gzip"))
3531
{
3632
return http::gzip_rfc1952;
3733
}
34+
if (boost::icontains(header_value, "deflate"))
35+
{
36+
return http::deflate_rfc1951;
37+
}
3838
return http::no_compression;
3939
}
4040

0 commit comments

Comments
 (0)