aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE_data/rest_param_all.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-12-12 11:37:48 +0100
committerLoïc Hoguin <[email protected]>2017-12-12 11:37:48 +0100
commiteafca21198b08dfa356cb9b1ec87f80375a2af23 (patch)
tree8ac377df5ac4591c5a71fbc875b8fffa8ef65b15 /test/http_SUITE_data/rest_param_all.erl
parent01e13c0846a15a1f18ac586b68a6b9e6feb5c692 (diff)
downloadcowboy-eafca21198b08dfa356cb9b1ec87f80375a2af23.tar.gz
cowboy-eafca21198b08dfa356cb9b1ec87f80375a2af23.tar.bz2
cowboy-eafca21198b08dfa356cb9b1ec87f80375a2af23.zip
Fix HTTP/1.1 pipelining
Cases where a request body was involved could sometimes fail depending on timing. Also fix all of the old http_SUITE tests.
Diffstat (limited to 'test/http_SUITE_data/rest_param_all.erl')
-rw-r--r--test/http_SUITE_data/rest_param_all.erl5
1 files changed, 3 insertions, 2 deletions
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}.