diff options
Diffstat (limited to 'test/http_handler_set_resp.erl')
-rw-r--r-- | test/http_handler_set_resp.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/http_handler_set_resp.erl b/test/http_handler_set_resp.erl index 83d48c0..db22168 100644 --- a/test/http_handler_set_resp.erl +++ b/test/http_handler_set_resp.erl @@ -8,23 +8,23 @@ init({_Transport, http}, Req, Opts) -> Headers = proplists:get_value(headers, Opts, []), Body = proplists:get_value(body, Opts, <<"http_handler_set_resp">>), {ok, Req2} = lists:foldl(fun({Name, Value}, {ok, R}) -> - cowboy_http_req:set_resp_header(Name, Value, R) + cowboy_req:set_resp_header(Name, Value, R) end, {ok, Req}, Headers), - {ok, Req3} = cowboy_http_req:set_resp_body(Body, Req2), - {ok, Req4} = cowboy_http_req:set_resp_header( + {ok, Req3} = cowboy_req:set_resp_body(Body, Req2), + {ok, Req4} = cowboy_req:set_resp_header( <<"X-Cowboy-Test">>, <<"ok">>, Req3), - {ok, Req5} = cowboy_http_req:set_resp_cookie( + {ok, Req5} = cowboy_req:set_resp_cookie( <<"cake">>, <<"lie">>, [], Req4), {ok, Req5, undefined}. handle(Req, State) -> - case cowboy_http_req:has_resp_header(<<"X-Cowboy-Test">>, Req) of + case cowboy_req:has_resp_header(<<"X-Cowboy-Test">>, Req) of false -> {ok, Req, State}; true -> - case cowboy_http_req:has_resp_body(Req) of + case cowboy_req:has_resp_body(Req) of false -> {ok, Req, State}; true -> - {ok, Req2} = cowboy_http_req:reply(200, Req), + {ok, Req2} = cowboy_req:reply(200, Req), {ok, Req2, State} end end. |