aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'test/handlers')
-rw-r--r--test/handlers/asterisk_h.erl2
-rw-r--r--test/handlers/echo_h.erl2
-rw-r--r--test/handlers/hello_h.erl2
-rw-r--r--test/handlers/loop_handler_body_h.erl5
4 files changed, 6 insertions, 5 deletions
diff --git a/test/handlers/asterisk_h.erl b/test/handlers/asterisk_h.erl
index b5ff32d..56b8bcb 100644
--- a/test/handlers/asterisk_h.erl
+++ b/test/handlers/asterisk_h.erl
@@ -13,4 +13,4 @@ echo(What, Req, Opts) ->
V when is_integer(V) -> integer_to_binary(V);
V -> V
end,
- {ok, cowboy_req:reply(200, [], Value, Req), Opts}.
+ {ok, cowboy_req:reply(200, #{}, Value, Req), Opts}.
diff --git a/test/handlers/echo_h.erl b/test/handlers/echo_h.erl
index 71408c3..6db43fe 100644
--- a/test/handlers/echo_h.erl
+++ b/test/handlers/echo_h.erl
@@ -13,4 +13,4 @@ echo(What, Req, Opts) ->
V when is_integer(V) -> integer_to_binary(V);
V -> V
end,
- {ok, cowboy_req:reply(200, [], Value, Req), Opts}.
+ {ok, cowboy_req:reply(200, #{}, Value, Req), Opts}.
diff --git a/test/handlers/hello_h.erl b/test/handlers/hello_h.erl
index 3be7b6d..5e3dcc8 100644
--- a/test/handlers/hello_h.erl
+++ b/test/handlers/hello_h.erl
@@ -5,4 +5,4 @@
-export([init/2]).
init(Req, Opts) ->
- {ok, cowboy_req:reply(200, [], <<"Hello world!">>, Req), Opts}.
+ {ok, cowboy_req:reply(200, #{}, <<"Hello world!">>, Req), Opts}.
diff --git a/test/handlers/loop_handler_body_h.erl b/test/handlers/loop_handler_body_h.erl
index 0d4fd4d..38ba2c0 100644
--- a/test/handlers/loop_handler_body_h.erl
+++ b/test/handlers/loop_handler_body_h.erl
@@ -14,9 +14,10 @@ init(Req, _) ->
{cowboy_loop, Req, undefined, 5000, hibernate}.
info(timeout, Req, State) ->
- {ok, Body, Req2} = cowboy_req:body(Req),
+ {ok, Body, Req2} = cowboy_req:read_body(Req),
100000 = byte_size(Body),
- {stop, cowboy_req:reply(200, Req2), State}.
+ cowboy_req:reply(200, Req2),
+ {stop, Req, State}.
terminate(stop, _, _) ->
ok.