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

Woonsan Ko edited comment on CXF-3897 at 11/9/11 3:14 PM:
----------------------------------------------------------

Attaching a patch to suggest a fix.
This patch includes:
(1) Leaving a warning log when undefined _type parameter value is used.
(2) Do not update accept type header when undefined _type parameter is used. 
So, in that case, because it doesn't update accept type header, it will use the 
default accept type (e.g., 'xml') as default type instead of throwing an 
exception.

The patch was locally applied to cxf-2.3.x-fixes, cxf-2.4.x-fixes and cxf-TRUNK 
and passed all the unit tests under rt/frontend/jaxrs.

Thanks!
                
      was (Author: woon_san):
    Attaching a patch to suggest a fix.
This patch includes:
(1) Leaving a warning log when undefined _type parameter value is used.
(2) Do not update accept type header when undefined _type parameter is used. 
So, in that case, because it doesn't update accept type header, it will use the 
default accept type (e.g., 'xml') as default type instead of throwing an 
exception.

The patch was locally applied to cxf-2.3.x-fixes, cxf-2.4.x-fixes and cxf-TRUNK 
locally and passed all the unit tests under rt/frontend/jaxrs.

Thanks!
                  
> Better handling on invalid JAXRS '_type' parameter
> --------------------------------------------------
>
>                 Key: CXF-3897
>                 URL: https://issues.apache.org/jira/browse/CXF-3897
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.3.7, 2.4.3, 2.5
>            Reporter: Woonsan Ko
>            Priority: Minor
>             Fix For: 2.3.8, 2.4.4, 2.5.1
>
>         Attachments: CXF-3897.patch
>
>
> From the discussion on the user list:
> > From: Sergey Beryozkin <[email protected]>
> > To: [email protected]
> > Cc: 
> > Sent: Tuesday, November 8, 2011 4:44 PM
> > Subject: Re: No warning on invalid _type parameter
> > 
> > Hi
> > On 08/11/11 19:41, Woonsan Ko wrote:
> >> Hi,
> >> 
> >> When an undefined _type parameter is used for JAX-RS requests (e.g., 
> > ?_type=foo), it doesn't give any warning logs. It just returns 406 http 
> > error code.
> > Enabling the fine logging should tell that no Accept header was matched...
> >> It seems better to give a proper warning log in 
> > o.a.cxf.jaxrs.impl.RequestPreprocessor#handleTypeQuery() method in that 
> > case.
> >> Also, it currently uses the invalid type as Accept header even though 
> > there's no shortcut registered for the type parameter value.
> > 
> > Agreed - it's a bug
> > 
> >> Shall I create an JIRA issue with a patch for this?
> >> 
> > Yes please, thanks
> > Sergey
> > 
> >> Kind regards,
> >> 
> >> Woonsan
> >

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to