aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/http_SUITE.erl14
-rw-r--r--test/http_SUITE_data/rest_param_all.erl5
2 files changed, 13 insertions, 6 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 203378c..52ef86b 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -464,9 +464,15 @@ rest_keepalive(Config) ->
rest_keepalive_post(Config) ->
ConnPid = gun_open(Config),
Refs = [begin
- Ref1 = gun:post(ConnPid, "/forbidden_post", [{<<"content-type">>, <<"text/plain">>}]),
+ Ref1 = gun:post(ConnPid, "/forbidden_post", [
+ {<<"content-type">>, <<"text/plain">>},
+ {<<"content-length">>, <<"12">>}
+ ]),
gun:data(ConnPid, Ref1, fin, "Hello world!"),
- Ref2 = gun:post(ConnPid, "/simple_post", [{<<"content-type">>, <<"text/plain">>}]),
+ Ref2 = gun:post(ConnPid, "/simple_post", [
+ {<<"content-type">>, <<"text/plain">>},
+ {<<"content-length">>, <<"12">>}
+ ]),
gun:data(ConnPid, Ref2, fin, "Hello world!"),
{Ref1, Ref2}
end || _ <- lists:seq(1, 5)],
@@ -550,8 +556,8 @@ rest_resource_etags(Config) ->
{200, <<"\"etag-header-value\"">>, "tuple-strong"},
{200, <<"W/\"etag-header-value\"">>, "binary-weak-quoted"},
{200, <<"\"etag-header-value\"">>, "binary-strong-quoted"},
- {400, false, "binary-strong-unquoted"},
- {400, false, "binary-weak-unquoted"}
+ {500, false, "binary-strong-unquoted"},
+ {500, false, "binary-weak-unquoted"}
],
_ = [{Status, ETag, Type} = begin
{Ret, RespETag} = rest_resource_get_etag(Config, Type),
diff --git a/test/http_SUITE_data/rest_param_all.erl b/test/http_SUITE_data/rest_param_all.erl
index d74df74..784214b 100644
--- a/test/http_SUITE_data/rest_param_all.erl
+++ b/test/http_SUITE_data/rest_param_all.erl
@@ -17,7 +17,7 @@ content_types_provided(Req, State) ->
{[{{<<"text">>, <<"plain">>, '*'}, get_text_plain}], Req, State}.
get_text_plain(Req, State) ->
- {_, _, Param} = maps:get(media_type, Req, {{<<"text">>, <<"plain">>}, []}),
+ {_, _, Param} = maps:get(media_type, Req, {<<"text">>, <<"plain">>, []}),
Body = if
Param == '*' ->
<<"'*'">>;
@@ -31,5 +31,6 @@ get_text_plain(Req, State) ->
content_types_accepted(Req, State) ->
{[{{<<"text">>, <<"plain">>, '*'}, put_text_plain}], Req, State}.
-put_text_plain(Req, State) ->
+put_text_plain(Req0, State) ->
+ {ok, _, Req} = cowboy_req:read_body(Req0),
{true, Req, State}.