-
Notifications
You must be signed in to change notification settings - Fork 187
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
accept-encoding.acceptable_offers is not very useful for the common use case #387
Comments
@whiteroses do you have any thoughts about this? |
@mmerickel Sorry, I'm not quite understanding the issue? Why is
is not actually using the
From WebOb 1.7.4, the original
For comparison:
and
|
@whiteroses I don't want to get too bogged down in the details of how best_match used to work. I get that there's things going on there. The focus of my issue is that the common use case for accept-encoding is the snippet I described at the bottom of my issue and it'd be nice if we could come up with a way to provide an api around it. The RFC states that any encoding is acceptable when there is no header provided, but in practice literally no one wants that - they want a default (of likely 'identity') when a header is not provided. |
@mmerickel Was just reassuring you that this was not handled by the deprecated best_match api, so nothing was lost. I think I understand what you are looking for now: I can make a PR with a |
While this api is compliant with the RFC at https://tools.ietf.org/html/rfc7231#section-5.3.4, it is not what anybody really expects or wants in the case of a missing header. The answer is pretty much always to use
identity
when a header is missing. This is what the deprecatedbest_match
api used to do, withbest_match(['identity', 'gzip'], default_match='identity')
.The proposed api would be something that implements the following:
This is very similar to
best_match
but without any weird server-side quality multiplier logic.The text was updated successfully, but these errors were encountered: