[
https://issues.apache.org/jira/browse/CXF-7903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16691944#comment-16691944
]
Thorsten Glaser edited comment on CXF-7903 at 11/19/18 4:33 PM:
----------------------------------------------------------------
I tried:
[https://github.com/tarent/cxf/commit/c25cdcfb7fbe5e5e35453dcec9fb90efc139e11b]
I could not get things to work, though. I have a {{ContainerResponseFilter}}
[^CanReturnOtherStatusCodesFilter.java] that attempts to change the status code
and phrase *after* the service method has ended, from a field in the returned
object. (The method returns a POJO to be returned as JSON and does *not* use
the {{Response}} object way of returning.) This works for the code, but the
phrase is *always* just taken from the {{Response.Status}} enum, or numeric if
unknown; my phrase is summarily ignored.
was (Author: mirabilos):
I tried:
[https://github.com/tarent/cxf/commit/c25cdcfb7fbe5e5e35453dcec9fb90efc139e11b]
I could not get things to work, though. I have a {{ContainerResponseFilter}}
[^CanReturnOtherStatusCodesFilter.java] that attempts to change the status code
and phrase *after* the service method has ended, from a field in the response
object. This works for the code, but the phrase is *always* just taken from the
{{Response.Status}} enum, or numeric if unknown; my phrase is summarily ignored.
> AbstractResponseContextImpl.setStatusInfo() is kidding me
> ---------------------------------------------------------
>
> Key: CXF-7903
> URL: https://issues.apache.org/jira/browse/CXF-7903
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.2.7
> Reporter: Thorsten Glaser
> Priority: Major
> Attachments: CanReturnOtherStatusCodesFilter.java
>
>
> The method {{AbstractResponseContextImpl.setStatusInfo(status)}} calls
> {{r.setStatus(status.getStatusCode())}} instead of
> {{r.setStatusInfo(status)}} which is completely disabling the ability to set
> custom HTTP response status phrases.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)