Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7809E739A for ; Mon, 26 Sep 2011 16:35:11 +0000 (UTC) Received: (qmail 16006 invoked by uid 500); 26 Sep 2011 16:35:11 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 15949 invoked by uid 500); 26 Sep 2011 16:35:11 -0000 Mailing-List: contact commits-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 commits@cxf.apache.org Received: (qmail 15942 invoked by uid 99); 26 Sep 2011 16:35:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2011 16:35:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2011 16:35:10 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C2DAA2388A64 for ; Mon, 26 Sep 2011 16:34:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1175943 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Date: Mon, 26 Sep 2011 16:34:49 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110926163449.C2DAA2388A64@eris.apache.org> Author: sergeyb Date: Mon Sep 26 16:34:49 2011 New Revision: 1175943 URL: http://svn.apache.org/viewvc?rev=1175943&view=rev Log: Merged revisions 1175939 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1175939 | sergeyb | 2011-09-26 17:29:51 +0100 (Mon, 26 Sep 2011) | 1 line [CXF-3822] Returning 406 in case of malformed Accept header values ........ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Sep 26 16:34:49 2011 @@ -1 +1 @@ -/cxf/trunk:1175648,1175747-1175780 +/cxf/trunk:1175648,1175747-1175780,1175939 Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1175943&r1=1175942&r2=1175943&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java (original) +++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java Mon Sep 26 16:34:49 2011 @@ -131,7 +131,12 @@ public class JAXRSInInterceptor extends acceptTypes = "*/*"; message.put(Message.ACCEPT_CONTENT_TYPE, acceptTypes); } - List acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes); + List acceptContentTypes = null; + try { + JAXRSUtils.sortMediaTypes(acceptTypes); + } catch (IllegalArgumentException ex) { + throw new WebApplicationException(406); + } message.getExchange().put(Message.ACCEPT_CONTENT_TYPE, acceptContentTypes); MultivaluedMap values = new MetadataMap(); Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1175943&r1=1175942&r2=1175943&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java (original) +++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Mon Sep 26 16:34:49 2011 @@ -74,6 +74,15 @@ public class JAXRSClientServerBookTest e } @Test + public void testMalformedAcceptType() { + WebClient wc = + WebClient.create("http://localhost:" + PORT + "/bookstore/books/123"); + wc.accept("application"); + Response r = wc.get(); + assertEquals(406, r.getStatus()); + } + + @Test public void testProxyWrongAddress() throws Exception { BookStore store = JAXRSClientFactory.create("http://localhost:8080/wrongaddress", BookStore.class);