aboutsummaryrefslogtreecommitdiffstats
path: root/test/rfc7231_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-12-06 00:30:59 +0100
committerLoïc Hoguin <[email protected]>2017-12-06 00:30:59 +0100
commitdd002b81417dabac10daf28cbab00179e7bdf95f (patch)
tree279a0ad211e7bceac571ec1b03e35d9f12271d05 /test/rfc7231_SUITE.erl
parent10dc2c2ef0ea4f89f7c9cbe7b886ce6327196115 (diff)
downloadcowboy-dd002b81417dabac10daf28cbab00179e7bdf95f.tar.gz
cowboy-dd002b81417dabac10daf28cbab00179e7bdf95f.tar.bz2
cowboy-dd002b81417dabac10daf28cbab00179e7bdf95f.zip
Disable the CONNECT method completely
It's safer than allow it with the wrong behavior.
Diffstat (limited to 'test/rfc7231_SUITE.erl')
-rw-r--r--test/rfc7231_SUITE.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/rfc7231_SUITE.erl b/test/rfc7231_SUITE.erl
index 2bafc87..bbd7ec5 100644
--- a/test/rfc7231_SUITE.erl
+++ b/test/rfc7231_SUITE.erl
@@ -129,8 +129,14 @@ method_delete(Config) ->
{ok, <<"DELETE">>} = gun:await_body(ConnPid, Ref),
ok.
-%% @todo Should probably disable CONNECT and TRACE entirely until they're implemented.
-%method_connect(Config) ->
+method_connect(Config) ->
+ doc("The CONNECT method is currently not implemented. (RFC7231 4.3.6)"),
+ ConnPid = gun_open(Config),
+ Ref = gun:request(ConnPid, <<"CONNECT">>, "localhost:8080", [
+ {<<"accept-encoding">>, <<"gzip">>}
+ ]),
+ {response, fin, 501, _} = gun:await(ConnPid, Ref),
+ ok.
method_options(Config) ->
doc("The OPTIONS method is accepted. (RFC7231 4.3.7)"),
@@ -145,6 +151,7 @@ method_options(Config) ->
%method_options_asterisk(Config) ->
%method_options_content_length_0(Config) ->
+%% @todo Should probably disable TRACE entirely until they're implemented.
%method_trace(Config) ->
%% Request headers.