-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
There is no charset parameter on application/json #6901
Comments
Interesting, thanks. I don't know that this has come up before. We actually had It is interesting that the RFC also says "Adding [a charset] really has no effect on compliant recipients," which suggests that including one should be harmless for compliant recipients. But wait, https://www.rfc-editor.org/errata/eid5853 says that that sentence should be replaced :\ I'd have to read more to understand whether including a There's additionally the question of whether the Our internal security guidance says that it is "critical" to include the Someone seems to be reporting that Dart needed the parameter back in 2019. Ditto some "HttpClient" in 2020. And I've seen another report or two that some receivers reject anything that includes I fear that we could end up the latest project to have "ping-ponging this back and forth, and there's always some broken client." We could consider talking more with our security people to see what they recommend. We'd want to have a pretty solid understanding before nudging users toward a change that might break something that had previously been working (whether it was really supposed to be working or not). |
In general, are extra, unrecognized parameters considered an error in media types? |
That's marked as "Reported", which just means that someone thought it would be a good idea to make that change. I don't think we can conclude anything from it. (I've been fooled by RFC Errata before.) |
Exactly - unless it's verified it doesn't mean anything. |
Usually no. The problem is more educational: sending "charset=UTF-8" sort of implies that "charset=UTF-16" would change the encoding detection. And that would be a bug. As would be to require the presence of the param. |
Description
Ref: https://datatracker.ietf.org/doc/html/rfc8259#section-11 (last paragraph)
But see:
guava/guava/src/com/google/common/net/MediaType.java
Line 492 in f347fb7
This type should be deprecated (and users encouraged to use a variant without charset).
Example
Expected Behavior
Use should lead to a deprecation warning.
Actual Behavior
It does not.
Packages
com.google.common.net
Platforms
No response
Checklist
The text was updated successfully, but these errors were encountered: