cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1336747 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ systests/jaxrs/src/test/java/org/apa...
Date Thu, 10 May 2012 15:35:06 GMT
Author: sergeyb
Date: Thu May 10 15:35:06 2012
New Revision: 1336747

URL: http://svn.apache.org/viewvc?rev=1336747&view=rev
Log:
[CXF-4307] Setting a default in Cookie separator to ';'

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java?rev=1336747&r1=1336746&r2=1336747&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
Thu May 10 15:35:06 2012
@@ -49,6 +49,7 @@ public class HttpHeadersImpl implements 
         "org.apache.cxf.http.cookie.separator";
     private static final String COOKIE_SEPARATOR_CRLF = "crlf";
     private static final String DEFAULT_SEPARATOR = ",";
+    private static final String DEFAULT_COOKIE_SEPARATOR = ";";
     
     private static final String COMPLEX_HEADER_EXPRESSION = 
         "(([\\w]+=\"[^\"]*\")|([\\w]+=[\\w]+)|([\\w]+))(;(([\\w]+=\"[^\"]*\")|([\\w]+=[\\w]+)|([\\w]+)))?";
@@ -114,7 +115,7 @@ public class HttpHeadersImpl implements 
             return COOKIE_SEPARATOR_CRLF.equals(cookiePropValue.toString()) 
                 ? "\r\n" : cookiePropValue.toString();
         } else {
-            return DEFAULT_SEPARATOR;
+            return DEFAULT_COOKIE_SEPARATOR;
         }
     }
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java?rev=1336747&r1=1336746&r2=1336747&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/HttpHeadersImplTest.java
Thu May 10 15:35:06 2012
@@ -240,7 +240,7 @@ public class HttpHeadersImplTest extends
         Message m = new MessageImpl();
         m.setExchange(new ExchangeImpl());
         MetadataMap<String, String> headers = createHeaders();
-        headers.putSingle(HttpHeaders.COOKIE, "a=b,c=d");
+        headers.putSingle(HttpHeaders.COOKIE, "a=b;c=d");
         m.put(Message.PROTOCOL_HEADERS, headers);
         HttpHeaders h = new HttpHeadersImpl(m);
         Map<String, Cookie> cookies = h.getCookies();
@@ -250,15 +250,15 @@ public class HttpHeadersImplTest extends
     }
     
     @Test
-    public void testGetCookiesWithSemiColon() throws Exception {
+    public void testGetCookiesWithComma() throws Exception {
         
         Message m = new MessageImpl();
         Exchange ex = new ExchangeImpl();
         ex.setInMessage(m);
-        ex.put("org.apache.cxf.http.cookie.separator", ";");
+        ex.put("org.apache.cxf.http.cookie.separator", ",");
         m.setExchange(ex);
         MetadataMap<String, String> headers = createHeaders();
-        headers.putSingle(HttpHeaders.COOKIE, "a=b" + ";" + "c=d");
+        headers.putSingle(HttpHeaders.COOKIE, "a=b,c=d");
         m.put(Message.PROTOCOL_HEADERS, headers);
         HttpHeaders h = new HttpHeadersImpl(m);
         Map<String, Cookie> cookies = h.getCookies();

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=1336747&r1=1336746&r2=1336747&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
Thu May 10 15:35:06 2012
@@ -784,7 +784,7 @@ public class JAXRSUtilsTest extends Asse
         Method m = Customer.class.getMethod("testMultipleCookieParam", argType);
         MessageImpl messageImpl = new MessageImpl();
         MultivaluedMap<String, String> headers = new MetadataMap<String, String>();
-        headers.add("Cookie", "c1=c1Value, c2=c2Value");
+        headers.add("Cookie", "c1=c1Value; c2=c2Value");
         headers.add("Cookie", "c3=c3Value");
         messageImpl.put(Message.PROTOCOL_HEADERS, headers);
         List<Object> params = JAXRSUtils.processParameters(new OperationResourceInfo(m,
null),

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1336747&r1=1336746&r2=1336747&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Thu May 10 15:35:06 2012
@@ -1761,7 +1761,7 @@ public class JAXRSClientServerBookTest e
                                int expectedStatus) throws Exception {
         GetMethod get = new GetMethod(address);
         get.setRequestHeader("Accept", acceptType);
-        get.addRequestHeader("Cookie", "a=b,c=d");
+        get.addRequestHeader("Cookie", "a=b;c=d");
         get.addRequestHeader("Cookie", "e=f");
         get.setRequestHeader("Accept-Language", "da;q=0.8,en");
         get.setRequestHeader("Book", "1,2,3");



Mime
View raw message