Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HTTP compression precedence #6331

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

mjjbell
Copy link
Member

@mjjbell mjjbell commented Aug 25, 2022

Issue

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.

Tasklist

Requirements / Relations

#6330

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.
if (boost::icontains(header_value, "deflate"))
{
return http::deflate_rfc1951;
}
if (boost::icontains(header_value, "gzip"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR according to HTTP spec we should rely on order of encodings in accept-encoding header, i.e. if

Accept-Encoding: gzip, deflate

it means that gzip is preferred by client and if we support it we should use it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, right now the server's compression preference is the one that works 🙂
But yes, we should improve this. Another reason why it would be good to replace the custom HTTP server in osrm-routed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean to do it now, it was just a note :)

@mjjbell mjjbell merged commit c204360 into Project-OSRM:master Aug 25, 2022
SiarheiFedartsou added a commit that referenced this pull request Oct 14, 2022
mattwigway pushed a commit to mattwigway/osrm-backend that referenced this pull request Jul 20, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants