aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-12-13 15:56:36 +0100
committerIngela Anderton Andin <[email protected]>2016-12-21 10:46:49 +0100
commitcea3593337b0f57cd6e7a199eddc5be79f6d9b08 (patch)
tree8c78ce19bffb2c9022a618b4dd6aaea8ae01a7bf /lib/inets/test
parent226f2347ec096b605851df7a7a9e21db51eddb84 (diff)
downloadotp-cea3593337b0f57cd6e7a199eddc5be79f6d9b08.tar.gz
otp-cea3593337b0f57cd6e7a199eddc5be79f6d9b08.tar.bz2
otp-cea3593337b0f57cd6e7a199eddc5be79f6d9b08.zip
inets: httpc - Prevent hanging user process
Input should be checked and httpc_handler process shall terminate gracefully on errors so that user process will in hang in gen_server:call.
Diffstat (limited to 'lib/inets/test')
-rw-r--r--lib/inets/test/httpc_SUITE.erl18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 0d241833d5..8aea38037d 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -88,7 +88,8 @@ real_requests()->
stream_through_mfa,
streaming_error,
inet_opts,
- invalid_headers
+ invalid_headers,
+ invalid_body
].
only_simulated() ->
@@ -1002,10 +1003,25 @@ invalid_headers(Config) ->
Request = {url(group_name(Config), "/dummy.html", Config), [{"cookie", undefined}]},
{error, _} = httpc:request(get, Request, [], []).
+%%-------------------------------------------------------------------------
+
+invalid_body(Config) ->
+ URL = url(group_name(Config), "/dummy.html", Config),
+ try
+ httpc:request(post, {URL, [], <<"text/plain">>, "foobar"},
+ [], []),
+ ct:fail(accepted_invalid_input)
+ catch
+ error:function_clause ->
+ ok
+ end.
+
+%%-------------------------------------------------------------------------
remote_socket_close(Config) when is_list(Config) ->
URL = url(group_name(Config), "/just_close.html", Config),
{error, socket_closed_remotely} = httpc:request(URL).
+
%%-------------------------------------------------------------------------
remote_socket_close_async(Config) when is_list(Config) ->