diff options
author | Henrik Nord <[email protected]> | 2014-03-21 16:38:24 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-03-21 16:38:26 +0100 |
commit | c9da6c2f06efa410462299a20e10206843082ac8 (patch) | |
tree | 232833be955649dd25bfc05375b4b7b803a15460 /lib/inets/src/http_client/httpc_cookie.erl | |
parent | ae7a69f2840009d2313a52887bb2964347736954 (diff) | |
parent | 4a955764995cc2298605bdf75f11b10b73fa45a5 (diff) | |
download | otp-c9da6c2f06efa410462299a20e10206843082ac8.tar.gz otp-c9da6c2f06efa410462299a20e10206843082ac8.tar.bz2 otp-c9da6c2f06efa410462299a20e10206843082ac8.zip |
Merge branch 'scrapinghub/empty_set_cookie'
* scrapinghub/empty_set_cookie:
Added a condition to ignore empty Set-Cookie header and tests for it
OTP-11803
Diffstat (limited to 'lib/inets/src/http_client/httpc_cookie.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc_cookie.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/inets/src/http_client/httpc_cookie.erl b/lib/inets/src/http_client/httpc_cookie.erl index 69900bae65..134115bdfa 100644 --- a/lib/inets/src/http_client/httpc_cookie.erl +++ b/lib/inets/src/http_client/httpc_cookie.erl @@ -335,7 +335,8 @@ add_domain(Str, #http_cookie{domain = Domain}) -> Str ++ "; $Domain=" ++ Domain. parse_set_cookies(CookieHeaders, DefaultPathDomain) -> - SetCookieHeaders = [Value || {"set-cookie", Value} <- CookieHeaders], + %% empty Set-Cookie header is invalid according to RFC but some sites violate it + SetCookieHeaders = [Value || {"set-cookie", Value} <- CookieHeaders, Value /= ""], Cookies = [parse_set_cookie(SetCookieHeader, DefaultPathDomain) || SetCookieHeader <- SetCookieHeaders], %% print_cookies("Parsed Cookies", Cookies), |