aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test/httpc_SUITE.erl
diff options
context:
space:
mode:
authorZandra <[email protected]>2015-11-20 10:22:36 +0100
committerZandra <[email protected]>2015-11-20 10:22:36 +0100
commit94ea0c1218cfb8480d37775f0c2a82452c897360 (patch)
treea5c6c2600af2f72f422953e994ea7c8e8f1f8196 /lib/inets/test/httpc_SUITE.erl
parent00db647274f87aa87f4bb7245fc95a1effe72466 (diff)
parent25c9d0c38d659cc00db461d760f66369e9024c54 (diff)
downloadotp-94ea0c1218cfb8480d37775f0c2a82452c897360.tar.gz
otp-94ea0c1218cfb8480d37775f0c2a82452c897360.tar.bz2
otp-94ea0c1218cfb8480d37775f0c2a82452c897360.zip
Merge branch 'weisslj/fix-inets-crash-on-invalid-chunk-size' into maint
* weisslj/fix-inets-crash-on-invalid-chunk-size: inets: Terminate really gracefully on bad chunk OTP-13117
Diffstat (limited to 'lib/inets/test/httpc_SUITE.erl')
-rw-r--r--lib/inets/test/httpc_SUITE.erl21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 989563cdbc..c6c59ab1af 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -106,6 +106,7 @@ only_simulated() ->
bad_response,
internal_server_error,
invalid_http,
+ invalid_chunk_size,
headers_dummy,
headers_with_obs_fold,
empty_response_header,
@@ -765,6 +766,22 @@ invalid_http(Config) when is_list(Config) ->
ct:print("Parse error: ~p ~n", [Reason]).
%%-------------------------------------------------------------------------
+
+invalid_chunk_size(doc) ->
+ ["Test parse error of HTTP chunk size"];
+invalid_chunk_size(suite) ->
+ [];
+invalid_chunk_size(Config) when is_list(Config) ->
+
+ URL = url(group_name(Config), "/invalid_chunk_size.html", Config),
+
+ {error, {chunk_size, _} = Reason} =
+ httpc:request(get, {URL, []}, [], []),
+
+ ct:print("Parse error: ~p ~n", [Reason]).
+
+%%-------------------------------------------------------------------------
+
emulate_lower_versions(doc) ->
[{doc, "Perform request as 0.9 and 1.0 clients."}];
emulate_lower_versions(Config) when is_list(Config) ->
@@ -1876,6 +1893,10 @@ handle_uri(_,"/invalid_http.html",_,_,_,_) ->
"HTTP/1.1 301\r\nDate:Sun, 09 Dec 2007 13:04:18 GMT\r\n" ++
"Transfer-Encoding:chunked\r\n\r\n";
+handle_uri(_,"/invalid_chunk_size.html",_,_,_,_) ->
+ "HTTP/1.1 200 ok\r\n" ++
+ "Transfer-Encoding:chunked\r\n\r\nåäö\r\n";
+
handle_uri(_,"/missing_reason_phrase.html",_,_,_,_) ->
"HTTP/1.1 200\r\n" ++
"Content-Length: 32\r\n\r\n"