DefaultSlingScript unconditionally sets the response character encoding
-----------------------------------------------------------------------
Key: SLING-679
URL: https://issues.apache.org/jira/browse/SLING-679
Project: Sling
Issue Type: Bug
Components: Scripting
Affects Versions: Scripting Core 2.0.2
Reporter: Felix Meschberger
Assignee: Felix Meschberger
Fix For: Scripting Core 2.0.4
The DefaultSlingScript.service method, which is called by the Sling runtime to
execute a script to handle a request, sets the response content type and
character encoding. While the content type is only set if it can be defaulted
throught the request (SlingHttpServletRequest.getResponseContentType()) the
charatcer encoding is unconditionally set to UTF-8.
This causes such interesting content type headers as "image/png;
charset=UTF-8", which is not technically wrong, but certainly strange.
It would be more correct to only set the default character encoding if the
default content type as retrieved from the request is a text content type, e.g.
text/plain, text/html, text/x-whatever.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.