[ 
https://issues.apache.org/jira/browse/WW-4558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15464301#comment-15464301
 ] 

Lukasz Lenart commented on WW-4558:
-----------------------------------

I think this changes was wrong, the interceptor shouldn't base on {{Accept}} 
header as this is what JSON Result should produce. The interceptor is used to 
convert JSON into an object and it must base on {{Content-Type}} header of the 
request ({{Accept}} is used on response). Please check WW-4684 were such 
problem was reported.

I'm working on an example app and based on that I'm going to refactor the 
interceptor to use {{Content-Type}} again with option to override possible 
values accepted as {{Content-Type}} - similar to current approach with 
{{Accept}} header.

> contentType override ignored for JSONInterceptor
> ------------------------------------------------
>
>                 Key: WW-4558
>                 URL: https://issues.apache.org/jira/browse/WW-4558
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.3.24
>            Reporter: Jasper Rosenberg
>            Priority: Minor
>             Fix For: 2.5.1
>
>
> JSONInterceptor takes a contentType parameter, but as far as I can tell does 
> nothing with it.  I would think a reasonable way to use it would be to have 
> it used if available, rather than the content type from the request so that 
> the interceptor can be used when receiving a JSON post from a third party 
> that does not set the correct content type.
> PR https://github.com/apache/struts/pull/87



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to