cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1338734 - in /cxf/branches/2.4.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 Tue, 15 May 2012 14:45:32 GMT
Author: sergeyb
Date: Tue May 15 14:45:32 2012
New Revision: 1338734

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

................
  r1338733 | sergeyb | 2012-05-15 15:41:59 +0100 (Tue, 15 May 2012) | 9 lines
  
  Merged revisions 1338730 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1338730 | sergeyb | 2012-05-15 15:38:31 +0100 (Tue, 15 May 2012) | 1 line
    
    Updating HttpHeaders to recognize Cookie parameters marked with $, JIRA to be updated
once it is up
  ........
................

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/impl/HttpHeadersImpl.java
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.5.x-fixes:r1338733
  Merged /cxf/trunk:r1338730

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/impl/HttpHeadersImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java?rev=1338734&r1=1338733&r2=1338734&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
Tue May 15 14:45:32 2012
@@ -100,7 +100,9 @@ public class HttpHeadersImpl implements 
             if (value == null) {
                 continue;
             }
-            List<String> cs = getHeaderValues(HttpHeaders.COOKIE, value, getCookieSeparator());
+            List<String> cs = value.contains("$")
+                ? Collections.singletonList(value)
+                : getHeaderValues(HttpHeaders.COOKIE, value, getCookieSeparator());
             for (String c : cs) {
                 Cookie cookie = Cookie.valueOf(c);
                 cl.put(cookie.getName(), cookie);

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java?rev=1338734&r1=1338733&r2=1338734&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
Tue May 15 14:45:32 2012
@@ -250,6 +250,22 @@ public class HttpHeadersImplTest extends
     }
     
     @Test
+    public void testGetCookieWithAttributes() throws Exception {
+        
+        Message m = new MessageImpl();
+        m.setExchange(new ExchangeImpl());
+        MetadataMap<String, String> headers = createHeaders();
+        headers.putSingle(HttpHeaders.COOKIE, "$Version=1;a=b");
+        m.put(Message.PROTOCOL_HEADERS, headers);
+        HttpHeaders h = new HttpHeadersImpl(m);
+        Map<String, Cookie> cookies = h.getCookies();
+        assertEquals(1, cookies.size());
+        Cookie cookie = cookies.get("a");
+        assertEquals("b", cookie.getValue());
+        assertEquals(1, cookie.getVersion());
+    }
+    
+    @Test
     public void testGetCookiesWithComma() throws Exception {
         
         Message m = new MessageImpl();



Mime
View raw message