aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE_data/http_set_resp.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/http_SUITE_data/http_set_resp.erl')
-rw-r--r--test/http_SUITE_data/http_set_resp.erl12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/http_SUITE_data/http_set_resp.erl b/test/http_SUITE_data/http_set_resp.erl
index 628f745..77196a8 100644
--- a/test/http_SUITE_data/http_set_resp.erl
+++ b/test/http_SUITE_data/http_set_resp.erl
@@ -1,10 +1,11 @@
%% Feel free to use, reuse and abuse the code in this file.
-module(http_set_resp).
--behaviour(cowboy_http_handler).
--export([init/3, handle/2, terminate/3]).
-init({_Transport, http}, Req, Opts) ->
+-export([init/2]).
+-export([handle/2]).
+
+init(Req, Opts) ->
Headers = proplists:get_value(headers, Opts, []),
Body = proplists:get_value(body, Opts, <<"http_handler_set_resp">>),
Req2 = lists:foldl(fun({Name, Value}, R) ->
@@ -13,7 +14,7 @@ init({_Transport, http}, Req, Opts) ->
Req3 = cowboy_req:set_resp_body(Body, Req2),
Req4 = cowboy_req:set_resp_header(<<"x-cowboy-test">>, <<"ok">>, Req3),
Req5 = cowboy_req:set_resp_cookie(<<"cake">>, <<"lie">>, [], Req4),
- {ok, Req5, undefined}.
+ {http, Req5, undefined}.
handle(Req, State) ->
case cowboy_req:has_resp_header(<<"x-cowboy-test">>, Req) of
@@ -26,6 +27,3 @@ handle(Req, State) ->
{ok, cowboy_req:reply(200, Req), State}
end
end.
-
-terminate(_, _, _) ->
- ok.