aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-03-18 10:22:03 +0100
committerIngela Anderton Andin <[email protected]>2013-03-18 10:53:38 +0100
commitce52178afbfa9b70d0ebf0a3c974a2bf2c134d30 (patch)
tree4deb68084bd1caaa94c07bd379fe702ebd0088a0 /lib/inets/test
parent676982407bf45c437de8059def8b7ce7435162cf (diff)
downloadotp-ce52178afbfa9b70d0ebf0a3c974a2bf2c134d30.tar.gz
otp-ce52178afbfa9b70d0ebf0a3c974a2bf2c134d30.tar.bz2
otp-ce52178afbfa9b70d0ebf0a3c974a2bf2c134d30.zip
inets httpc: Revert incorrect commit regarding cookie handling.
Diffstat (limited to 'lib/inets/test')
-rw-r--r--lib/inets/test/httpc_SUITE.erl29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index c20ec63448..350192464e 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -90,6 +90,7 @@ real_requests()->
only_simulated() ->
[
cookie,
+ cookie_profile,
trace,
stream_once,
no_content_204,
@@ -489,9 +490,37 @@ cookie(Config) when is_list(Config) ->
{ok, {{_,200,_}, [_ | _], [_|_]}}
= httpc:request(get, Request1, [], []),
+ [{session_cookies, [_|_]}] = httpc:which_cookies(httpc:default_profile()),
+
ets:delete(cookie),
ok = httpc:set_options([{cookies, disabled}]).
+
+
+%%-------------------------------------------------------------------------
+cookie_profile() ->
+ [{doc, "Test cookies on a non default profile."}].
+cookie_profile(Config) when is_list(Config) ->
+ inets:start(httpc, [{profile, cookie_test}]),
+ ok = httpc:set_options([{cookies, enabled}], cookie_test),
+
+ Request0 = {url(group_name(Config), "/cookie.html", Config), []},
+
+ {ok, {{_,200,_}, [_ | _], [_|_]}}
+ = httpc:request(get, Request0, [], [], cookie_test),
+
+ %% Populate table to be used by the "dummy" server
+ ets:new(cookie, [named_table, public, set]),
+ ets:insert(cookie, {cookies, true}),
+
+ Request1 = {url(group_name(Config), "/", Config), []},
+
+ {ok, {{_,200,_}, [_ | _], [_|_]}}
+ = httpc:request(get, Request1, [], [], cookie_test),
+
+ ets:delete(cookie),
+ inets:stop(httpc, cookie_test).
+
%%-------------------------------------------------------------------------
headers_as_is(doc) ->
["Test the option headers_as_is"];