cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6997) Accept header doesn't correctly support multiple media ranges
Date Mon, 08 Aug 2016 12:47:20 GMT

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

Sergey Beryozkin commented on CXF-6997:
---------------------------------------

Hmm... See
https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java

where does it split with a "," ? 
Looking at the stack trace suggests a call is made from your custom response filter, what
do you do there ?

Thanks

> Accept header doesn't correctly support multiple media ranges
> -------------------------------------------------------------
>
>                 Key: CXF-6997
>                 URL: https://issues.apache.org/jira/browse/CXF-6997
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.1.6
>            Reporter: Jeff Moroski
>
> An Accept value of {{application/*+xml,application/*+xml;version=25.0,application/*+xml;version=1.5}}
is valid according to [Section 5.3.2 of RFC 7231|https://tools.ietf.org/html/rfc7231#section-5.3.2],
but when a media range and no corresponding accept params exists anywhere but the end of the
value, the MediaTypeHeaderProvider fails to process the value correctly:
> {noformat}
> Server stack trace: java.lang.IllegalArgumentException: Invalid media type string: application/*+xml,application/*+xml;version=25.0,application/*+xml;version=1.5
> at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.internalValueOf(MediaTypeHeaderProvider.java:90)
> at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.valueOf(MediaTypeHeaderProvider.java:65)
> at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.fromString(MediaTypeHeaderProvider.java:55)
> at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.fromString(MediaTypeHeaderProvider.java:42)
> at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
> {noformat}



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

Mime
View raw message