0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00

Add cowboy_http_req:set_resp_cookie/4

Pretty much just an alias for a combination of set_resp_header and cookie.
This commit is contained in:
Loïc Hoguin 2011-12-07 11:54:57 +01:00
parent a12a910341
commit ce92ab1e63
3 changed files with 13 additions and 3 deletions

View file

@ -13,7 +13,9 @@ init({_Transport, http}, Req, Opts) ->
{ok, Req3} = cowboy_http_req:set_resp_body(Body, Req2),
{ok, Req4} = cowboy_http_req:set_resp_header(
<<"X-Cowboy-Test">>, <<"ok">>, Req3),
{ok, Req4, undefined}.
{ok, Req5} = cowboy_http_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