hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1674059 - in /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie: LaxExpiresHandler.java RFC6265CookieSpec.java
Date Thu, 16 Apr 2015 12:21:13 GMT
Author: olegk
Date: Thu Apr 16 12:21:13 2015
New Revision: 1674059

URL: http://svn.apache.org/r1674059
Log:
HTTPCLIENT-1640: RFC6265 lax cookie policy fails to parse 'max-age' attribute

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java?rev=1674059&r1=1674058&r2=1674059&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
Thu Apr 16 12:21:13 2015
@@ -214,7 +214,7 @@ public class LaxExpiresHandler extends A
 
     @Override
     public String getAttributeName() {
-        return ClientCookie.MAX_AGE_ATTR;
+        return ClientCookie.EXPIRES_ATTR;
     }
 
 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java?rev=1674059&r1=1674058&r2=1674059&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java
Thu Apr 16 12:21:13 2015
@@ -151,7 +151,8 @@ public class RFC6265CookieSpec implement
 
         final Map<String, String> attribMap = new LinkedHashMap<String, String>();
         while (!cursor.atEnd()) {
-            final String paramName = tokenParser.parseToken(buffer, cursor, TOKEN_DELIMS);
+            final String paramName = tokenParser.parseToken(buffer, cursor, TOKEN_DELIMS)
+                    .toLowerCase(Locale.ROOT);
             String paramValue = null;
             if (!cursor.atEnd()) {
                 final int paramDelim = buffer.charAt(cursor.getPos());
@@ -163,7 +164,7 @@ public class RFC6265CookieSpec implement
                     }
                 }
             }
-            cookie.setAttribute(paramName.toLowerCase(Locale.ROOT), paramValue);
+            cookie.setAttribute(paramName, paramValue);
             attribMap.put(paramName, paramValue);
         }
         // Ignore 'Expires' if 'Max-Age' is present



Mime
View raw message