[
https://issues.apache.org/jira/browse/HTTPCLIENT-1640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14496859#comment-14496859
]
Ivan Shcheklein commented on HTTPCLIENT-1640:
---------------------------------------------
Request config:
{code:java}
RequestConfig rc = RequestConfig.custom()
.setConnectTimeout(HTTP_CONNECT_TIMEOUT)
.setSocketTimeout(HTTP_SOCKET_TIMEOUT)
.setCircularRedirectsAllowed(true)
.setMaxRedirects(Configuration.MAX_REDIRECTS)
.setConnectionRequestTimeout(HTTP_POOL_TIMEOUT)
.setRedirectsEnabled(true)
.setCookieSpec(CookieSpecs.STANDARD).build();
{code}
It has to follow several redirects before this error happens:
{code}
...
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
GET
/business/latest/dropbox-microsoft-deepen-integration/story-e6frg90f-1227301360790?nk=22bf22d541262a2656f5c09ea9043b5f
HTTP/1.1
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
Accept-Encoding: gzip, deflate
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
Accept: */*
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
Host: www.theaustralian.com.au
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
Connection: Keep-Alive
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
User-Agent: Mozilla/5.0 (compatible; TweetedTimes Bot/1.0;
+http://tweetedtimes.com)
2015:04:15 23:13:04,734 [DEBUG] org.apache.http.headers - http-outgoing-3 >>
Cookie: JSESSIONID=E1B54955A8CB12713207985D7DA4A4DC.s08-0;
SS_X_JSESSIONID=36ACD9CC0BED11283100742BF7FDFDB0; n_regis=123456789; nkr=1
2015:04:15 23:13:04,849 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
HTTP/1.1 302 Moved Temporarily
2015:04:15 23:13:04,849 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Server: Apache-Coyote/1.1
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Content-Length: 153
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Content-Type: text/html
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Location:
https://sslcam.news.com.au/cam/authorise?channel=pc&url=http%3a%2f%2fwww.theaustralian.com.au%2fbusiness%2flatest%2fdropbox-microsoft-deepen-integration%2fstory-e6frg90f-1227301360790%3fnk%3d22bf22d541262a2656f5c09ea9043b5f
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Set-Cookie: nk=22bf22d541262a2656f5c09ea9043b5f; expires=Sat, 14 Apr 2018
20:13:04 GMT; path=/; domain=.theaustralian.com.au
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Set-Cookie: sr=true; path=/; expires=Wed, 15 Apr 2015 20:20:04 GMT; max-age=30;
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Set-Cookie: open_token=anonymous; path=/; domain=.theaustralian.com.au
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Set-Cookie: n_rme=1429128784; path=/; expires=Wed, 15 Apr 2015 21:13:04 GMT;
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Set-Cookie: nk_ts=1429128784; expires=Sat, 14 Apr 2018 20:13:04 GMT; path=/;
domain=.theaustralian.com.au
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Set-Cookie: nk_src=fw.raw_esi; expires=Sat, 14 Apr 2018 20:13:04 GMT; path=/;
domain=.theaustralian.com.au
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
X-Cache-Lookup: MISS from news.com.au:80
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
X-Metering: max: None count: None access: None meteredaccess: free membertype:
anonymous meteredconfig: 1 redirected: 1 referral: 0 byPassUsrAgent: 0
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
X-UA-Compatible: IE=edge,chrome=1
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Vary: Accept-Encoding
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Expires: Wed, 15 Apr 2015 20:13:04 GMT
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Cache-Control: max-age=0, no-cache, no-store
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Pragma: no-cache
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Date: Wed, 15 Apr 2015 20:13:04 GMT
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.headers - http-outgoing-3 <<
Connection: keep-alive
2015:04:15 23:13:04,850 [DEBUG] org.apache.http.impl.execchain.MainClientExec -
Connection can be kept alive for 60000 MILLISECONDS
2015:04:15 23:13:04,851 [DEBUG]
org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted
[nk="22bf22d541262a2656f5c09ea9043b5f", version:0, domain:theaustralian.com.au,
path:/, expiry:null]
---------
2015:04:15 23:13:04,851 [WARN ]
org.apache.http.client.protocol.ResponseProcessCookies - Invalid cookie header:
"Set-Cookie: sr=true; path=/; expires=Wed, 15 Apr 2015 20:20:04 GMT;
max-age=30;". Invalid 'expires' attribute: 30
---------
2015:04:15 23:13:04,851 [DEBUG]
org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted
[open_token="anonymous", version:0, domain:theaustralian.com.au, path:/,
expiry:null]
2015:04:15 23:13:04,852 [DEBUG]
org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted
[n_rme="1429128784", version:0, domain:www.theaustralian.com.au, path:/,
expiry:null]
2015:04:15 23:13:04,852 [DEBUG]
org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted
[nk_ts="1429128784", version:0, domain:theaustralian.com.au, path:/,
expiry:null]
2015:04:15 23:13:04,852 [DEBUG]
org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted
[nk_src="fw.raw_esi", version:0, domain:theaustralian.com.au, path:/,
expiry:null]
2015:04:15 23:13:04,852 [DEBUG] org.apache.http.impl.execchain.RedirectExec -
Resetting target auth state
...
{code}
> 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
>
> [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: [email protected]
For additional commands, e-mail: [email protected]