mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix how we require HTTP/1.0 from Gun in rfc7231_SUITE
This commit is contained in:
parent
388a68fc2e
commit
01e13c0846
2 changed files with 4 additions and 4 deletions
|
@ -112,8 +112,7 @@ gun_open(Config, Opts) ->
|
||||||
retry => 0,
|
retry => 0,
|
||||||
transport => config(type, Config),
|
transport => config(type, Config),
|
||||||
transport_opts => proplists:get_value(transport_opts, Config, []),
|
transport_opts => proplists:get_value(transport_opts, Config, []),
|
||||||
protocols => [config(protocol, Config)],
|
protocols => [config(protocol, Config)]
|
||||||
http_opts => proplists:get_value(http_opts, Config, #{})
|
|
||||||
}),
|
}),
|
||||||
ConnPid.
|
ConnPid.
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
-import(ct_helper, [config/2]).
|
-import(ct_helper, [config/2]).
|
||||||
-import(ct_helper, [doc/1]).
|
-import(ct_helper, [doc/1]).
|
||||||
-import(cowboy_test, [gun_open/1]).
|
-import(cowboy_test, [gun_open/1]).
|
||||||
|
-import(cowboy_test, [gun_open/2]).
|
||||||
-import(cowboy_test, [raw_open/1]).
|
-import(cowboy_test, [raw_open/1]).
|
||||||
-import(cowboy_test, [raw_send/2]).
|
-import(cowboy_test, [raw_send/2]).
|
||||||
-import(cowboy_test, [raw_recv_head/1]).
|
-import(cowboy_test, [raw_recv_head/1]).
|
||||||
|
@ -241,7 +242,7 @@ do_http10_expect(Config) ->
|
||||||
doc("A server that receives a 100-continue expectation "
|
doc("A server that receives a 100-continue expectation "
|
||||||
"in an HTTP/1.0 request must ignore it. (RFC7231 5.1.1)"),
|
"in an HTTP/1.0 request must ignore it. (RFC7231 5.1.1)"),
|
||||||
Body = <<"hello=world">>,
|
Body = <<"hello=world">>,
|
||||||
ConnPid = gun_open([{http_opts, #{version => 'HTTP/1.0'}}|Config]),
|
ConnPid = gun_open(Config, #{http_opts => #{version => 'HTTP/1.0'}}),
|
||||||
Ref = gun:post(ConnPid, "/echo/read_body", [
|
Ref = gun:post(ConnPid, "/echo/read_body", [
|
||||||
{<<"accept-encoding">>, <<"gzip">>},
|
{<<"accept-encoding">>, <<"gzip">>},
|
||||||
{<<"content-type">>, <<"application/x-www-form-urlencoded">>},
|
{<<"content-type">>, <<"application/x-www-form-urlencoded">>},
|
||||||
|
@ -437,7 +438,7 @@ http10_status_code_101(Config) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
do_http10_status_code_1xx(StatusCode, Config) ->
|
do_http10_status_code_1xx(StatusCode, Config) ->
|
||||||
ConnPid = gun_open([{http_opts, #{version => 'HTTP/1.0'}}|Config]),
|
ConnPid = gun_open(Config, #{http_opts => #{version => 'HTTP/1.0'}}),
|
||||||
Ref = gun:get(ConnPid, "/resp/inform2/" ++ integer_to_list(StatusCode), [
|
Ref = gun:get(ConnPid, "/resp/inform2/" ++ integer_to_list(StatusCode), [
|
||||||
{<<"accept-encoding">>, <<"gzip">>}
|
{<<"accept-encoding">>, <<"gzip">>}
|
||||||
]),
|
]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue