cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1525684 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/
Date Mon, 23 Sep 2013 20:23:23 GMT
Author: sergeyb
Date: Mon Sep 23 20:23:23 2013
New Revision: 1525684

URL: http://svn.apache.org/r1525684
Log:
Merged revisions 1525391,1525403 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1525391 | sergeyb | 2013-09-22 18:13:27 +0100 (Sun, 22 Sep 2013) | 1 line
  
  If JAX-RS Destination Factory is auto-discovered then set the related property
........
  r1525403 | sergeyb | 2013-09-22 18:52:43 +0100 (Sun, 22 Sep 2013) | 1 line
  
  HttpHeadersImpl can not ignore multiple list values, not a problem on the server, problem
with Response.abortWith and filters
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1525391,1525403

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

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1525684&r1=1525683&r2=1525684&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Mon Sep 23 20:23:23 2013
@@ -130,6 +130,7 @@ public class AbstractJAXRSFactoryBean ex
             if (df == null) {
                 DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class);
                 df = dfm.getDestinationFactoryForUri(getAddress());
+                super.setDestinationFactory(df);
             }
 
             if (df != null) {

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java?rev=1525684&r1=1525683&r2=1525684&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
Mon Sep 23 20:23:23 2013
@@ -90,7 +90,10 @@ public class HttpHeadersImpl implements 
         if (lValues == null || lValues.isEmpty() || lValues.get(0) == null) {
             return Collections.singletonList(MediaType.WILDCARD_TYPE);
         }
-        List<MediaType> mediaTypes = JAXRSUtils.parseMediaTypes(lValues.get(0));
+        List<MediaType> mediaTypes = new LinkedList<MediaType>();
+        for (String value : lValues) {
+            mediaTypes.addAll(JAXRSUtils.parseMediaTypes(value));
+        }
         sortMediaTypesUsingQualityFactor(mediaTypes); 
         return mediaTypes;
     }
@@ -216,7 +219,11 @@ public class HttpHeadersImpl implements 
         if (HttpUtils.isDateRelatedHeader(headerName)) {
             return values;
         }
-        return getHeaderValues(headerName, values.get(0));
+        List<String> actualValues = new LinkedList<String>();
+        for (String v : values) {
+            actualValues.addAll(getHeaderValues(headerName, v));
+        }
+        return actualValues;
     }
     
     private List<String> getHeaderValues(String headerName, String originalValue) {

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java?rev=1525684&r1=1525683&r2=1525684&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
Mon Sep 23 20:23:23 2013
@@ -243,6 +243,19 @@ public class HttpHeadersImplTest extends
     }
     
     @Test
+    public void testGetHeader2() throws Exception {
+        
+        Message m = new MessageImpl();
+        m.put(Message.PROTOCOL_HEADERS, createHeaders());
+        HttpHeaders h = new HttpHeadersImpl(m);
+        
+        List<String> values = h.getRequestHeader("a");
+        assertEquals(2, values.size());
+        assertEquals("1", values.get(0));
+        assertEquals("2", values.get(1));
+    }
+    
+    @Test
     public void testGetMediaTypes() throws Exception {
         
         Message m = control.createMock(Message.class);
@@ -416,7 +429,8 @@ public class HttpHeadersImplTest extends
         
     private MetadataMap<String, String> createHeaders() {
         MetadataMap<String, String> hs = new MetadataMap<String, String>();
-        hs.putSingle("Accept", "text/bar;q=0.6,text/*;q=1,application/xml");
+        hs.add("Accept", "text/bar;q=0.6");
+        hs.add("Accept", "text/*;q=1,application/xml");
         hs.putSingle("Content-Type", "*/*");
         hs.putSingle("Date", "Tue, 21 Oct 2008 17:00:00 GMT");
         hs.putSingle("Content-Length", "10");



Mime
View raw message