Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0C50F17E29 for ; Tue, 4 Nov 2014 10:55:34 +0000 (UTC) Received: (qmail 86513 invoked by uid 500); 4 Nov 2014 10:55:33 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 86474 invoked by uid 500); 4 Nov 2014 10:55:33 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 86463 invoked by uid 99); 4 Nov 2014 10:55:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Nov 2014 10:55:33 +0000 Date: Tue, 4 Nov 2014 10:55:33 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6076) MediaType parameter not parsed correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14195992#comment-14195992 ] Sergey Beryozkin commented on CXF-6076: --------------------------------------- FYI, testTypeWithExtendedParametersQuote() test is invalid, it expects a parameter without the quotes, but indeed testTypeWithExtendedAndBoundaryParameter() was failing, fixed now, thanks > MediaType parameter not parsed correctly > ----------------------------------------- > > Key: CXF-6076 > URL: https://issues.apache.org/jira/browse/CXF-6076 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.10, 2.7.13, 3.0.2 > Reporter: Ken Meyer > Fix For: 3.0.3, 2.7.14 > > > When MediaType parameter contains a plus symbol (+), the parameter is parse incorrectly. This appears to be the result of the RegEx Pattern, COMPLEX_PARAMETERS, used in class org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider. > org.apache.cxf.jaxrs.impl.MediaTypeHeaderProviderTest > Some test cases: > @Test > public void testTypeWithExtendedParameters() { > MediaType mt = MediaType.valueOf("multipart/related;type=application/dicom+xml"); > > assertEquals("multipart", mt.getType()); > assertEquals("related", mt.getSubtype()); > Map params2 = mt.getParameters(); > assertEquals(1, params2.size()); > assertEquals("application/dicom+xml", params2.get("type")); //SUCCESSFUL > } > @Test > public void testTypeWithExtendedParametersQuote() { > MediaType mt = MediaType.valueOf("multipart/related;type=\"application/dicom+xml\""); > > assertEquals("multipart", mt.getType()); > assertEquals("related", mt.getSubtype()); > Map params2 = mt.getParameters(); > assertEquals(1, params2.size()); > assertEquals("application/dicom+xml", params2.get("type")); //FAIL > } > > @Test > public void testTypeWithExtendedAndBoundaryParameter() { > MediaType mt = MediaType.valueOf("multipart/related; type=application/dicom+xml; boundary=\"uuid:b9aecb2a-ab37-48d6-a1cd-b2f4f7fa63cb\""); > > assertEquals("multipart", mt.getType()); > assertEquals("related", mt.getSubtype()); > Map params2 = mt.getParameters(); > assertEquals(2, params2.size()); > assertEquals("\"uuid:b9aecb2a-ab37-48d6-a1cd-b2f4f7fa63cb\"", params2.get("boundary")); > assertEquals("application/dicom+xml", params2.get("type")); //FAIL > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)