[ 
https://issues.apache.org/jira/browse/CXF-3822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ka-Lok Fung updated CXF-3822:
-----------------------------

    Description: 
If you send an Accept header that doesn't contain a slash (/), CXF's JAX-RS 
implementation returns a HTTP status of 500 (Internal Server Error). Instead of 
this status, it would be preferred if a HTTP status of 406 (Not Acceptable) is 
returned.

Here's the test header:

bq. {{Accept: foo}}

Here's the current response:

bq. {{Status Code: 500 org.apache.cxf.interceptor.Fault: Media type separator 
is missing}}

Here's the preferred response:

bq. {{Status Code: 406 Not Acceptable}}

I've attached a potential patch against trunk for this issue:

  was:
If you send an Accept header that doesn't contain a /, CXF's JAX-RS 
implementation returns a HTTP status of 500 (Internal Server Error). Instead of 
this status, it would be preferred if a HTTP status of 406 (Not Acceptable) is 
returned.

Here's the test header:

bq. {{Accept: foo}}

Here's the current response:

bq. {{Status Code: 500 org.apache.cxf.interceptor.Fault: Media type separator 
is missing}}

Here's the preferred response:

bq. {{Status Code: 406 Not Acceptable}}

I've attached a potential patch against trunk for this issue:


> JAX-RS: A 406 status could should be returned for an improperly formatted 
> Accept header
> ---------------------------------------------------------------------------------------
>
>                 Key: CXF-3822
>                 URL: https://issues.apache.org/jira/browse/CXF-3822
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.6, 2.4.2
>         Environment: Java 1.6
>            Reporter: Ka-Lok Fung
>            Priority: Minor
>             Fix For: 2.3.7, 2.4.3, 2.5
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> If you send an Accept header that doesn't contain a slash (/), CXF's JAX-RS 
> implementation returns a HTTP status of 500 (Internal Server Error). Instead 
> of this status, it would be preferred if a HTTP status of 406 (Not 
> Acceptable) is returned.
> Here's the test header:
> bq. {{Accept: foo}}
> Here's the current response:
> bq. {{Status Code: 500 org.apache.cxf.interceptor.Fault: Media type separator 
> is missing}}
> Here's the preferred response:
> bq. {{Status Code: 406 Not Acceptable}}
> I've attached a potential patch against trunk for this issue:

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to