Open pshaughn opened 4 years ago
It might make sense for client code to be able ask the Mime class two distinct questions that don't always have the same answer: "What charset is this content type?" and "What is the charset= parameter of this content type?" Currently, the API only syntactically exposes the second question, and what it returns is semantically somewhere between the two questions.
It seems we only lowercase parameter values for "charset"
.
I wonder if we could stop this lowercase in the mime crate and let users do it when necessary. but this could be a breaking change though :/
https://github.com/web-platform-tests/wpt/blob/master/fetch/api/basic/scheme-data.any.js expects to see specifically uppercase US-ASCII. This may be counterintuitive given RFC 7231! Even though charset names are case-insensitive within the context of http algorithms, it seems that the web platform tests expect their string case to be preserved when a specification (RFC 2397 here) has set a specific case.
https://github.com/servo/servo is currently using this Mime class and is trying to pass WPT tests.