diff options
author | Loïc Hoguin <[email protected]> | 2012-09-16 03:51:07 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-09-17 13:56:58 +0200 |
commit | 8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63 (patch) | |
tree | 916b1c238ce6dea4652e7b50341c37128ba633b2 /test/http_handler_set_resp.erl | |
parent | e13ab806eaadd40c72145b5783c7727f2ed88d14 (diff) | |
download | cowboy-8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63.tar.gz cowboy-8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63.tar.bz2 cowboy-8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63.zip |
Improve consistency of return types for cowboy_req API
The signature of parse_header, body_qs, multipart_data and
the set_resp_* functions has changed.
See the cowboy_req module edoc for more details.
Diffstat (limited to 'test/http_handler_set_resp.erl')
-rw-r--r-- | test/http_handler_set_resp.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/http_handler_set_resp.erl b/test/http_handler_set_resp.erl index db22168..806bca8 100644 --- a/test/http_handler_set_resp.erl +++ b/test/http_handler_set_resp.erl @@ -7,14 +7,12 @@ 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}) -> + Req2 = lists:foldl(fun({Name, Value}, R) -> cowboy_req:set_resp_header(Name, Value, R) - end, {ok, Req}, Headers), - {ok, Req3} = cowboy_req:set_resp_body(Body, Req2), - {ok, Req4} = cowboy_req:set_resp_header( - <<"X-Cowboy-Test">>, <<"ok">>, Req3), - {ok, Req5} = cowboy_req:set_resp_cookie( - <<"cake">>, <<"lie">>, [], Req4), + end, Req, Headers), + 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}. handle(Req, State) -> |