cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1175945 - in /cxf/branches/2.3.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:38:29 GMT
Author: sergeyb
Date: Mon Sep 26 16:38:29 2011
New Revision: 1175945

URL: http://svn.apache.org/viewvc?rev=1175945&view=rev
Log:
Merged revisions 1175943 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1175943 | sergeyb | 2011-09-26 17:34:49 +0100 (Mon, 26 Sep 2011) | 9 lines
  
  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.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 26 16:38:29 2011
@@ -1,2 +1,2 @@
-/cxf/branches/2.4.x-fixes:1172584,1173057,1173766,1174040,1174408,1175846
-/cxf/trunk:1172522,1173027,1173997-1173998,1174404,1175747-1175780
+/cxf/branches/2.4.x-fixes:1172584,1173057,1173766,1174040,1174408,1175846,1175943
+/cxf/trunk:1172522,1173027,1173997-1173998,1174404,1175747-1175780,1175939

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1175945&r1=1175944&r2=1175945&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Mon Sep 26 16:38:29 2011
@@ -131,7 +131,12 @@ public class JAXRSInInterceptor extends 
             acceptTypes = "*/*";
             message.put(Message.ACCEPT_CONTENT_TYPE, acceptTypes);
         }
-        List<MediaType> acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes);
+        List<MediaType> acceptContentTypes = null;
+        try {
+            JAXRSUtils.sortMediaTypes(acceptTypes);
+        } catch (IllegalArgumentException ex) {
+            throw new WebApplicationException(406);
+        }
         message.getExchange().put(Message.ACCEPT_CONTENT_TYPE, acceptContentTypes);
 
         MultivaluedMap<String, String> values = new MetadataMap<String, String>();

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1175945&r1=1175944&r2=1175945&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Mon Sep 26 16:38:29 2011
@@ -73,6 +73,14 @@ 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());
+    }
+    
     public void testGetBookWithCustomHeader() throws Exception {
         
         String endpointAddress =



Mime
View raw message