-
Bug
-
Resolution: Done
-
Major
-
3.0.16.Final
-
None
-
None
When using org.jboss.resteasy.plugins.providers.html.View from resteasy-html, headers and cookies set on the javax.ws.rs.Response are ignored.
This is due to the View dispatching to a non-wrapped and unmodified javax.servlet.http.HttpServletResponse (injected as @Context) therefore writing directly to the getWriter(), before Resteasy processes the headers from the javax.ws.rs.Response (this is because a MessageBodyWriter is given the possibility to alter headers).
The HtmlRenderableWriter should either arrange to write to the provided OutputStream (by wrapping the HttpServletResponse, or should process the incoming headers and apply/copy them to the HttpServletResponse (as is done in org.jboss.resteasy.core.ServerResponseWriter.commitHeaders).
It might be possible to trigger this commitHeaders code simply by flush()-ing the provided OutputStream; and this might be doable in a WriterInterceptor as a workaround (I need to test that).