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

Jason Klapste commented on CXF-5244:
------------------------------------

Previously you could add an interceptor before the JAXRSInInterceptor to check 
for and set either the Content-Type or Accept header via something like 
message.put(Message.ACCEPT_CONTENT_TYPE, ...)

This change, as it now checks Message.PROTOCOL_HEADERS first and always sets 
any value it finds in the message would override the above.

Is this expected behavior? Was setting the headers via 
message.put(Message.ACCEPT_CONTENT_TYPE, ...) the correct approach? Should 
JAXRSInInterceptor check for an existing header in the message before 
overriding?

> It is not possible to update Content-Type inside JAX-RS 2.0 
> ContainerRequestFilter 
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-5244
>                 URL: https://issues.apache.org/jira/browse/CXF-5244
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.6
>            Reporter: Dmitry Treskunov
>            Assignee: Sergey Beryozkin
>             Fix For: 2.7.7, 3.0.0
>
>
> As I understand, it wasn't possible to update headers inside JAX-RS 2.0 
> ContainerRequestFilter. 
> Is was fixed in this issue https://issues.apache.org/jira/browse/CXF-4986.
> But now update of Content-Type header inside of @PreMatching filter doesn't 
> affect further processing - 
> suitable MessageBodyReader is selected using initial Content-Type but not new 
> one.  



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to