mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add more rfc7231 tests and a new max_skip_body_length option
The option controls how much body we accept to skip for HTTP/1.1 connections when the user code did not consume the body fully. It defaults to 1MB.
This commit is contained in:
parent
c2b813684e
commit
b000d53855
5 changed files with 272 additions and 29 deletions
|
@ -66,40 +66,40 @@ common_groups(Tests) ->
|
|||
init_common_groups(Name = http, Config, Mod) ->
|
||||
init_http(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)}
|
||||
}, Config);
|
||||
}, [{flavor, vanilla}|Config]);
|
||||
init_common_groups(Name = https, Config, Mod) ->
|
||||
init_https(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)}
|
||||
}, Config);
|
||||
}, [{flavor, vanilla}|Config]);
|
||||
init_common_groups(Name = h2, Config, Mod) ->
|
||||
init_http2(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)}
|
||||
}, Config);
|
||||
}, [{flavor, vanilla}|Config]);
|
||||
init_common_groups(Name = h2c, Config, Mod) ->
|
||||
Config1 = init_http(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)}
|
||||
}, Config),
|
||||
}, [{flavor, vanilla}|Config]),
|
||||
lists:keyreplace(protocol, 1, Config1, {protocol, http2});
|
||||
init_common_groups(Name = http_compress, Config, Mod) ->
|
||||
init_http(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)},
|
||||
stream_handlers => [cowboy_compress_h, cowboy_stream_h]
|
||||
}, Config);
|
||||
}, [{flavor, compress}|Config]);
|
||||
init_common_groups(Name = https_compress, Config, Mod) ->
|
||||
init_https(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)},
|
||||
stream_handlers => [cowboy_compress_h, cowboy_stream_h]
|
||||
}, Config);
|
||||
}, [{flavor, compress}|Config]);
|
||||
init_common_groups(Name = h2_compress, Config, Mod) ->
|
||||
init_http2(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)},
|
||||
stream_handlers => [cowboy_compress_h, cowboy_stream_h]
|
||||
}, Config);
|
||||
}, [{flavor, compress}|Config]);
|
||||
init_common_groups(Name = h2c_compress, Config, Mod) ->
|
||||
Config1 = init_http(Name, #{
|
||||
env => #{dispatch => Mod:init_dispatch(Config)},
|
||||
stream_handlers => [cowboy_compress_h, cowboy_stream_h]
|
||||
}, Config),
|
||||
}, [{flavor, compress}|Config]),
|
||||
lists:keyreplace(protocol, 1, Config1, {protocol, http2}).
|
||||
|
||||
%% Support functions for testing using Gun.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue