hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1674058 - in /httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie: LaxExpiresHandler.java RFC6265CookieSpecBase.java
Date Thu, 16 Apr 2015 12:20:48 GMT
Author: olegk
Date: Thu Apr 16 12:20:48 2015
New Revision: 1674058

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

Modified:
    httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
    httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpecBase.java

Modified: httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java?rev=1674058&r1=1674057&r2=1674058&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
(original)
+++ httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java
Thu Apr 16 12:20:48 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/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpecBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpecBase.java?rev=1674058&r1=1674057&r2=1674058&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpecBase.java
(original)
+++ httpcomponents/httpclient/branches/4.4.x/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpecBase.java
Thu Apr 16 12:20:48 2015
@@ -151,7 +151,8 @@ class RFC6265CookieSpecBase implements C
 
         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 @@ class RFC6265CookieSpecBase implements C
                     }
                 }
             }
-            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