cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1329180 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java test/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProviderTest.java
Date Mon, 23 Apr 2012 11:08:06 GMT
Author: sergeyb
Date: Mon Apr 23 11:08:06 2012
New Revision: 1329180

URL: http://svn.apache.org/viewvc?rev=1329180&view=rev
Log:
[CXF-4259] Updating SetCookie handler to ignore the Expires property

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProviderTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java?rev=1329180&r1=1329179&r2=1329180&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
Mon Apr 23 11:08:06 2012
@@ -30,6 +30,7 @@ public class NewCookieHeaderProvider imp
     private static final String MAX_AGE = "Max-Age";
     private static final String COMMENT = "Comment";
     private static final String SECURE = "Secure";
+    private static final String EXPIRES = "Expires";
     
     public NewCookie fromString(String c) {
         
@@ -60,6 +61,9 @@ public class NewCookieHeaderProvider imp
                 comment = theToken.substring(COMMENT.length() + 1);
             } else if (theToken.startsWith(SECURE)) {
                 isSecure = true;
+            } else if (theToken.startsWith(EXPIRES)) {
+                // ignore
+                continue;
             } else {
                 int i = theToken.indexOf('=');
                 if (i != -1) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProviderTest.java?rev=1329180&r1=1329179&r2=1329180&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProviderTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProviderTest.java
Mon Apr 23 11:08:06 2012
@@ -38,6 +38,13 @@ public class NewCookieHeaderProviderTest
                    && "foo".equals(c.getName()));
     }
     
+    @Test
+    public void testFromSimpleStringWithExpires() {
+        NewCookie c = NewCookie.valueOf("foo=bar;Expires=Wed, 09 Jun 2021 10:18:14 GMT");
+        assertTrue("bar".equals(c.getValue())
+                   && "foo".equals(c.getName()));
+    }
+    
         
     @Test
     public void testFromComplexString() {



Mime
View raw message