From ead8a497f382d6b82c98721d504a5ccd40889b1c Mon Sep 17 00:00:00 2001 From: Kirilll Zaborsky Date: Mon, 2 Feb 2015 12:34:25 +0300 Subject: inets: parse correctly 'Set-Cookie' header with empty value httpc_cookie should parse cookies with empty values and no attributes set in the 'Set-Cookie' headers. --- lib/inets/src/http_client/httpc_cookie.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/inets/src') diff --git a/lib/inets/src/http_client/httpc_cookie.erl b/lib/inets/src/http_client/httpc_cookie.erl index 5d71a0bb8f..ed306a84f5 100644 --- a/lib/inets/src/http_client/httpc_cookie.erl +++ b/lib/inets/src/http_client/httpc_cookie.erl @@ -362,6 +362,8 @@ parse_set_cookie(CookieHeader, {DefaultPath, DefaultDomain}) -> Name = string:substr(CookieHeader, 1, Pos - 1), {Value, Attrs} = case string:substr(CookieHeader, Pos + 1) of + [] -> + {"", ""}; [$;|ValueAndAttrs] -> {"", string:tokens(ValueAndAttrs, ";")}; ValueAndAttrs -> -- cgit v1.2.3