cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r921491 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
Date Wed, 10 Mar 2010 18:01:39 GMT
Author: sergeyb
Date: Wed Mar 10 18:01:39 2010
New Revision: 921491

URL: http://svn.apache.org/viewvc?rev=921491&view=rev
Log:
Merged revisions 921475 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r921475 | sergeyb | 2010-03-10 17:44:39 +0000 (Wed, 10 Mar 2010) | 1 line
  
  CXF-2462 : another fix to do with handling quoted header values
........

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

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 10 18:01:39 2010
@@ -1 +1 @@
-/cxf/trunk:920741,920752,921014,921223
+/cxf/trunk:920741,920752,921014,921223,921475

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

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java?rev=921491&r1=921490&r2=921491&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
Wed Mar 10 18:01:39 2010
@@ -215,6 +215,11 @@ public class HttpHeadersImpl implements 
                 return newValues;
             }
         }
+        if (originalValue.startsWith("\"") && originalValue.endsWith("\"")) {
+            String actualValue = originalValue.length() == 2 ? "" 
+                : originalValue.substring(1, originalValue.length() - 1);
+            return Collections.singletonList(actualValue);
+        }
         List<String> values = new ArrayList<String>(4);
         Matcher m = COMPLEX_HEADER_PATTERN.matcher(originalValue);
         while (m.find()) {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java?rev=921491&r1=921490&r2=921491&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
Wed Mar 10 18:01:39 2010
@@ -112,6 +112,23 @@ public class HttpHeadersImplTest extends
         assertEquals("Nonce=\"bar\"", values.get(2));
     }
     
+    @Test
+    public void testGetHeaderWithQuotes3() throws Exception {
+        
+        Message m = control.createMock(Message.class);
+        m.get(Message.PROTOCOL_HEADERS);
+        MetadataMap<String, String> headers = 
+            createHeader("COMPLEX_HEADER", "\"value with space\"");
+        EasyMock.expectLastCall().andReturn(headers);
+        control.replay();
+        HttpHeaders h = new HttpHeadersImpl(m);
+        List<String> values = h.getRequestHeader("COMPLEX_HEADER");
+        assertNotNull(values);
+        assertEquals(1, values.size());
+        assertEquals("value with space", values.get(0));
+        
+    }
+    
     
     @Test
     public void testGetHeaders() throws Exception {



Mime
View raw message