[
https://issues.apache.org/jira/browse/CXF-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13740970#comment-13740970
]
Sergey Beryozkin commented on CXF-5201:
---------------------------------------
See
http://svn.apache.org/r1514272
we have a custom WriterInterceptor which adds headers via
WriterInterceptorContext and now directly via HttpServletResponse and the
client gets those headers.
Are you sure it does not work in CXF 2.7.6 ? If yes - please try CXF
2.7.7-SNAPSHOT in a day or so. If it still does not work - please create a
reproducible Maven-based test, or attach a simple war built against CXF 2.7.6
to this JIRA (without CXF libs if possible). Without being able to reproduce
I'll have to close this JIRA as Can't Reproduce, thanks
> jaxrs2: unable to intercept response to add new response headers
> ----------------------------------------------------------------
>
> Key: CXF-5201
> URL: https://issues.apache.org/jira/browse/CXF-5201
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.7.5, 2.7.6
> Environment: windows
> Reporter: abdelgadiri
>
> In a WriterInterceptor, one expects to be able to modify response headers via:
> //here using putSingle() but could also use on of the addXXX variants
> context.getHeaders().putSingle("headerName", headerValue);
> However, above is not working in 2.7.5/2.7.6 (@see JIRA-4986)
> As a workaround, one should be able to inject the HttpServletResponse object
> via: @Context HttpServletResponse response;
> then be able to add headers directly to the response object e.g.,
> response.setHeader("headerName", headerValue);
> however, above is also not working in (2.7.5/2.7.6). This is not always
> reproducable as sometimes my client does see the new headers in the received
> response. On closer look it seems the added headers get lost when it is a
> @GET request as opposed to e.g., a @POST. Basically, my test case (a @GET)
> always fails with a missing header in the received response even though I am
> pretty sure the server had added the header.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira