Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31636174C1 for ; Wed, 22 Apr 2015 17:04:26 +0000 (UTC) Received: (qmail 30406 invoked by uid 500); 22 Apr 2015 17:04:24 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 30053 invoked by uid 500); 22 Apr 2015 17:04:24 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 29510 invoked by uid 99); 22 Apr 2015 17:02:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2015 17:02:59 +0000 Date: Wed, 22 Apr 2015 17:02:59 +0000 (UTC) From: "Scott Blum (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1640) Failed to parse cookie max-age attribute MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14507421#comment-14507421 ] Scott Blum commented on HTTPCLIENT-1640: ---------------------------------------- It's not mentioned on this issue, but the fix for the issue actually fixes a really severe bug in RFC6265CookieSpecBase. Namely, mixed-cased cookie attributes were not being handled properly. For example, if the Set-Cookie header being parsed contained a "Path=/foo" attribute, the path would not be respected at all. This is because the attributeHandler lookup would fail (it's keyed to "path"). > Failed to parse cookie max-age attribute > ----------------------------------------- > > Key: HTTPCLIENT-1640 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1640 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpCookie > Affects Versions: 4.4.1 > Reporter: Ivan Shcheklein > Fix For: 4.5 > > > [Url to reproduce|http://bit.ly/1Oy8Eho] (need to follow redirects) > Logs: > {{2015:04:15 00:47:10,467 [WARN ] org.apache.http.client.protocol.ResponseProcessCookies - Invalid cookie header: "Set-Cookie: sr=true; path=/; expires=Tue, 14 Apr 2015 21:36:16 GMT; max-age=30;". Invalid 'expires' attribute: 30}} > {{RFC6265CookieSpecBase}} tries to parse max-age value with {{LaxExpiresHandler}} that expects value to be in a cookie-date format, as far I understand. Meanwhile [RFC6265 states|http://tools.ietf.org/html/rfc6265#page-20]: > "... Append an attribute to the cookie-attribute-list with an attribute-name of Max-Age and an attribute-value of expiry-time..." > [It seems|http://tools.ietf.org/html/rfc6265#page-19] it should just ignore invalid expires value anyway: > "...If the attribute-value failed to parse as a cookie date, ignore the > cookie-av..." -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org