-
Notifications
You must be signed in to change notification settings - Fork 43
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
Recommended response behavior when identity encoding is unacceptable #980
Comments
I agree that this is not optimal, but the proposed text would change the protocol from what is has been since RFC 7231. Given that the current draft is approved and in the publication queue, I don't think that a change is possible or even desirable. |
The move away from sending 406 was intentional in RFC7231. There is no implementation support for identity;q=0 overriding basic interoperability (200 response without encoding), unlike Accept for unwanted media types, because encodings are often applied late in the request handling process based on the server's analysis of whether they are efficient/possible. Hence, clients simply list the acceptable encodings and variance in the field values cause unwanted cache misses. The feature only made sense for non-compression encodings. This does not prevent a server from responding with 406, but doing so is less interoperable (without some additional knowledge about why the client is asking for that) than sending no encoding. |
If it is indeed intentional for absence of content coding to always be considered acceptable, then what is the purpose of keeping text that implies otherwise (emphasis mine)?
|
I meant that the move away from 406 was intentional. Suggesting that "identity;q=0" not be respected was not intentional, but is also not implemented AFAIK (It only makes sense for encryption-related encodings). I would suggest a less normative fix, like
and just send that now to the RFC editor as a clarification. |
Great, thanks! |
@royfielding - are you going to create a PR for this? |
Slightly relax requirements for handling Accept-Encoding field values (closes #980)
RFC 2616 specified that identity content-coding could be made unacceptable (e.g., indicating very strong preference for response compression) by means of an Accept-Encoding request header field value like
identity;q=0
or*;q=0
without an identity-specific preference, and then recommended that the server SHOULD respond with 406 (Not Acceptable) when it cannot send an acceptable response. But RFC 7231 and the current draft update that last point to "SHOULD send a response without any content-coding", presumably primarily intended to avoid sending 406 (Not Acceptable) when the acceptability of identity content-coding is unspecified. The text still includes a description of when identity content-coding is unacceptable and still accommodates a "compression is mandatory" interpretation ofAccept-Encoding: gzip, identity;q=0
, but seems to strongly discourage it in the sense of RFC 2119 ("there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course").I suspect this to be unintentional, and would propose clarification in semantics:
In the absence of such clarification, the text describing when identity content-coding is unacceptable seems to be largely pointless.
The text was updated successfully, but these errors were encountered: