[
https://issues.apache.org/jira/browse/SLING-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992980#comment-12992980
]
Felix Meschberger commented on SLING-1974:
------------------------------------------
The problem is, that the more we add, the more complex it becomes ...
Currently it behaves like this:
If there is a ":http-equiv-accept" request parameter use that as the list of
media types accepted/requested
Otherwise consider the Accept request header
Then build an internal sorted set from this value. Sort order is defined by the
q value and the concreteness of the main and sub types. That is text/html comes
before text/*. In a tie the types are string-compared. My patch replaces the
string-comparison by a declaration order thing. Which IMHO can be much better
defined.
So, basically, we do not need another mechanism to overwrite this ... the
client can overwrite the default Accept header with an :http-equiv-accept
request attribute and we are fine IMHO.
> Accept header issues in the Sling POST Servlet
> ----------------------------------------------
>
> Key: SLING-1974
> URL: https://issues.apache.org/jira/browse/SLING-1974
> Project: Sling
> Issue Type: Bug
> Components: Servlets
> Affects Versions: Servlets Post 2.1.0
> Reporter: Felix Meschberger
> Fix For: Servlets Post 2.1.2
>
> Attachments: SLING-1974.patch
>
>
> As of SLING-1336 the Sling POST Servlet can interpret the Accept request
> header to select what response content type to render.
> Unfortunately that handling seems broken as for an Accept header like (as
> generated by FireFox with the JSONovich plugin installed) :
> Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json
> the JSON response might be selected but sometimes also text/html (we can
> observe both behaviours for different server platforms with our application).
> The Accept header should probably consider equivalent q values (as for
> text/html and application/json in the example) to solve the tie by selecting
> the first type list; thus text/html in this example.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira