diff options
author | Zandra Hird <zandra@erlang.org> | 2015-02-05 10:15:06 +0100 |
---|---|---|
committer | Zandra Hird <zandra@erlang.org> | 2015-02-05 10:15:06 +0100 |
commit | ae5d5db20fe1d9b4cae2a19717ef010be1b8097f (patch) | |
tree | 6a3a803fb3b5d47b9771f51e2afbb3a14a4d2407 /lib/inets | |
parent | 8af91b0fed1bebafb7096782a3cc0b02a2d9b62f (diff) | |
parent | 280399ccfc3c4bd0e9c87c22bfc13045aae2bb76 (diff) | |
download | otp-ae5d5db20fe1d9b4cae2a19717ef010be1b8097f.tar.gz otp-ae5d5db20fe1d9b4cae2a19717ef010be1b8097f.tar.bz2 otp-ae5d5db20fe1d9b4cae2a19717ef010be1b8097f.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/src/http_client/httpc_cookie.erl | 2 | ||||
-rw-r--r-- | lib/inets/test/httpc_SUITE.erl | 1 |
2 files changed, 3 insertions, 0 deletions
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 -> diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 197491aefe..0e89e831fb 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -1738,6 +1738,7 @@ handle_uri(_,"/empty_set_cookie.html",_,_,_,_) -> handle_uri(_,"/invalid_set_cookie.html",_,_,_,_) -> "HTTP/1.1 200 ok\r\n" ++ "set-cookie: =\r\n" ++ + "set-cookie: name=\r\n" ++ "set-cookie: name-or-value\r\n" ++ "Content-Length:32\r\n\r\n"++ "<HTML><BODY>foobar</BODY></HTML>"; |