aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2016-12-16 13:13:15 +0100
committerLoïc Hoguin <[email protected]>2017-01-03 17:47:23 +0100
commitf59c29dff02b1b79652e93dec76a5a26f207e628 (patch)
treee585cb8d4f7fc4df6fe274ae1bc1528b09395fd4 /test
parent1048bff929791f18b7425d9cc7871d78d63cf4f8 (diff)
downloadcowboy-f59c29dff02b1b79652e93dec76a5a26f207e628.tar.gz
cowboy-f59c29dff02b1b79652e93dec76a5a26f207e628.tar.bz2
cowboy-f59c29dff02b1b79652e93dec76a5a26f207e628.zip
Return status 431 if the request header field is too large
This commit changes Cowboy to follow RFC6585.
Diffstat (limited to 'test')
-rw-r--r--test/http_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 1fa583a..e47557e 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -307,6 +307,20 @@ echo_body(Config) ->
end || Size <- lists:seq(MTU - 500, MTU)],
ok.
+%% Check if sending request whose header name is bigger than 64 bytes causes 431
+echo_body_max_header_name_length(Config) ->
+ ConnPid = gun_open(Config),
+ Ref = gun:post(ConnPid, "/echo/body", [{binary:copy(<<$a>>, 32768), <<"bad">>}], << "echo=name" >>),
+ {response, fin, 431, _} = gun:await(ConnPid, Ref),
+ ok.
+
+%% Check if sending request whose header name is bigger than 64 bytes causes 431
+echo_body_max_header_value_length(Config) ->
+ ConnPid = gun_open(Config),
+ Ref = gun:post(ConnPid, "/echo/body", [{<<"bad">>, binary:copy(<<$a>>, 32768)}], << "echo=name" >>),
+ {response, fin, 431, _} = gun:await(ConnPid, Ref),
+ ok.
+
%% Check if sending request whose size is bigger than 1000000 bytes causes 413
echo_body_max_length(Config) ->
ConnPid = gun_open(Config),