You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2014/11/14 14:15:33 UTC

[jira] [Commented] (CXF-6104) Support case insensitive mime types

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

Sergey Beryozkin commented on CXF-6104:
---------------------------------------

MediaType.equals() actually does a case-sensitive comparison; but indeed the method's docs refer to the fact the case sensitivty depends on the parameter names. For now I've added a retry case-insensitive equality if a parameter name is "charset".
I'll requalify this issue as a Minor Bug
thanks

> Support case insensitive mime types
> -----------------------------------
>
>                 Key: CXF-6104
>                 URL: https://issues.apache.org/jira/browse/CXF-6104
>             Project: CXF
>          Issue Type: New Feature
>          Components: JAX-RS
>    Affects Versions: 3.0.2
>            Reporter: Jostein Gogstad
>
> A request with header {code:none}Content-Type: application/json;charset=UTF-8{code} will not match a method annotated with {code:none}@Consumes("application/json; charset=utf-8"){code} This is unfortunate since the former casing of "UTF-8" is used by several front-end frameworks, for instance Google's [AngularJS (ngResource)|https://docs.angularjs.org/api/ngResource/service/$resource], and the latter casing is used several places by the Internet ([w3.org|http://www.w3.org/International/O-HTTP-charset.en.php] for example).
> The "bug" is located here:
> {code:java|title=org.apache.cxf.jaxrs.utils.JAXRSUtils#intersectMimeTypes(java.util.List<MediaType>, java.util.List<MediaType>, boolean, boolean)}
>                         if (value != null && !value.equals(entry.getValue())) {
> {code}
> should be
> {code:java}
>                         if (value != null && !value.equalsIgnoreCase(entry.getValue())) {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)