Summary: | AddDefaultCharsetFilter only supports text/* response | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | Fuwei Chin <fuweichin> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 8.5.24 | ||
Target Milestone: | ---- | ||
Hardware: | PC | ||
OS: | All |
Description
Fuwei Chin
2017-12-19 07:03:40 UTC
As documented, the filter applies to text/* resources, so your expectation is wrong and this is a possible enhancement. Please note that you have to adhere to specifications. The mime-types have official specifications for them and are registered with IANA, https://www.iana.org/assignments/media-types/media-types.xhtml The application/json mime-type DOES NOT have charset parameter, https://www.iana.org/assignments/media-types/application/json The application/javascript has charset parameter, though I am not sure whether it is actually respected by clients. https://www.iana.org/assignments/media-types/application/javascript https://tools.ietf.org/html/rfc4329#section-4.1 I'm -0 on supporting a change to add default charsets to MIME types other than text/* because those types (non-RFC) "should not" have them. On the other hand, sometimes the only way to make this stuff work with certain clients is to specify the charset for a MIME type that isn't supposed to support it (e.g. application/json). I won't stop anyone from doing it, but it will just make services continue to refuse to adhere to standards if we support something like this. Note: enhancement request withdrawn by the original reporter. |