aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client
diff options
context:
space:
mode:
authorKirilll Zaborsky <[email protected]>2014-03-06 15:40:26 +0400
committerKirilll Zaborsky <[email protected]>2014-03-06 15:57:52 +0400
commit4a955764995cc2298605bdf75f11b10b73fa45a5 (patch)
treead8b8f4223eafb18e036f452e07773cdedd84bd2 /lib/inets/src/http_client
parent23790daf1a2d384b0fc11c655fa825151d9fa420 (diff)
downloadotp-4a955764995cc2298605bdf75f11b10b73fa45a5.tar.gz
otp-4a955764995cc2298605bdf75f11b10b73fa45a5.tar.bz2
otp-4a955764995cc2298605bdf75f11b10b73fa45a5.zip
Added a condition to ignore empty Set-Cookie header and tests for it
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r--lib/inets/src/http_client/httpc_cookie.erl3
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),