diff options
author | Micael Karlberg <[email protected]> | 2011-09-06 12:16:47 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-09-06 12:16:47 +0200 |
commit | 9638b0e25fa4cce428b14fc9a1ede3e97a602c15 (patch) | |
tree | e3a1dd5bf787fa2b1e53a2415f2d150b2ac406ff /lib/inets/src/http_client/httpc_cookie.erl | |
parent | 5bdbfa33f7142b888f833b8f2f80cdf2198d9212 (diff) | |
parent | 68911f0221998d471114b6e6aac73d43d3025c8a (diff) | |
download | otp-9638b0e25fa4cce428b14fc9a1ede3e97a602c15.tar.gz otp-9638b0e25fa4cce428b14fc9a1ede3e97a602c15.tar.bz2 otp-9638b0e25fa4cce428b14fc9a1ede3e97a602c15.zip |
Merge branch 'bmk/inets/httpc/expire_data_cookie_parsing_error/OTP-9433' into bmk/inets/inets571_integration
Diffstat (limited to 'lib/inets/src/http_client/httpc_cookie.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc_cookie.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/inets/src/http_client/httpc_cookie.erl b/lib/inets/src/http_client/httpc_cookie.erl index 4d61f82b5a..e6e6c8cc81 100644 --- a/lib/inets/src/http_client/httpc_cookie.erl +++ b/lib/inets/src/http_client/httpc_cookie.erl @@ -375,10 +375,15 @@ cookie_attributes([{"max-age", Value}| Attributes], Cookie) -> Cookie#http_cookie{max_age = ExpireTime}); %% Backwards compatibility with netscape cookies cookie_attributes([{"expires", Value}| Attributes], Cookie) -> - Time = http_util:convert_netscapecookie_date(Value), - ExpireTime = calendar:datetime_to_gregorian_seconds(Time), - cookie_attributes(Attributes, - Cookie#http_cookie{max_age = ExpireTime}); + try http_util:convert_netscapecookie_date(Value) of + Time -> + ExpireTime = calendar:datetime_to_gregorian_seconds(Time), + cookie_attributes(Attributes, + Cookie#http_cookie{max_age = ExpireTime}) + catch + _:_ -> + cookie_attributes(Attributes, Cookie) + end; cookie_attributes([{"path", Value}| Attributes], Cookie) -> cookie_attributes(Attributes, Cookie#http_cookie{path = Value}); |