mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add more rfc7230 tests and better handle bad chunk sizes
Bad chunk sizes used to be accepted and could result in a badly parsed body or a timeout. They are now properly rejected. Chunk extensions now have a hard limit of 129 characters. I haven't heard of anyone using them and Cowboy does not provide an interface for them, but we can always increase or make configurable if it ever becomes necessary (but I honestly doubt it). Also a test from the old http suite could be removed. Yay!
This commit is contained in:
parent
1af508c4cd
commit
c4e43ec26a
4 changed files with 296 additions and 109 deletions
|
@ -307,19 +307,6 @@ http10_keepalive_forced(Config) ->
|
|||
_ -> ok
|
||||
end.
|
||||
|
||||
keepalive_max(Config) ->
|
||||
ConnPid = gun_open(Config),
|
||||
Refs = [gun:get(ConnPid, "/", [{<<"connection">>, <<"keep-alive">>}])
|
||||
|| _ <- lists:seq(1, 99)],
|
||||
CloseRef = gun:get(ConnPid, "/", [{<<"connection">>, <<"keep-alive">>}]),
|
||||
_ = [begin
|
||||
{response, nofin, 200, Headers} = gun:await(ConnPid, Ref),
|
||||
false = lists:keymember(<<"connection">>, 1, Headers)
|
||||
end || Ref <- Refs],
|
||||
{response, nofin, 200, Headers} = gun:await(ConnPid, CloseRef),
|
||||
{_, <<"close">>} = lists:keyfind(<<"connection">>, 1, Headers),
|
||||
gun_down(ConnPid).
|
||||
|
||||
keepalive_nl(Config) ->
|
||||
ConnPid = gun_open(Config),
|
||||
Refs = [begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue