aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-02-19 09:46:11 +0100
committerLoïc Hoguin <[email protected]>2017-02-19 09:46:11 +0100
commit91ae70b06c9cc486ea2c2cf91b94de799ceb53b2 (patch)
tree37cc4d2dffbaef0e103c1f834e7ae7117ffd51ca /src
parent87a05a12199cc9f0a569669d96d6c65761e8ff97 (diff)
downloadcowboy-91ae70b06c9cc486ea2c2cf91b94de799ceb53b2.tar.gz
cowboy-91ae70b06c9cc486ea2c2cf91b94de799ceb53b2.tar.bz2
cowboy-91ae70b06c9cc486ea2c2cf91b94de799ceb53b2.zip
Change the order of set_resp_cookie arguments
The Opts value is put last, to be more consistent with the rest of the cowboy_req module. Additionally a test handler was fixed which reduced the number of errors in http_SUITE.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_req.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 84bfee5..ca31105 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -548,7 +548,7 @@ stream_multipart(Req=#{multipart := {Boundary, Buffer}}, _) ->
-spec set_resp_cookie(iodata(), iodata(), Req)
-> Req when Req::req().
set_resp_cookie(Name, Value, Req) ->
- set_resp_cookie(Name, Value, #{}, Req).
+ set_resp_cookie(Name, Value, Req, #{}).
%% The cookie name cannot contain any of the following characters:
%% =,;\s\t\r\n\013\014
@@ -556,9 +556,9 @@ set_resp_cookie(Name, Value, Req) ->
%% The cookie value cannot contain any of the following characters:
%% ,; \t\r\n\013\014
%% @todo Fix the cookie_opts() type.
--spec set_resp_cookie(binary(), iodata(), cookie_opts(), Req)
+-spec set_resp_cookie(binary(), iodata(), Req, cookie_opts())
-> Req when Req::req().
-set_resp_cookie(Name, Value, Opts, Req) ->
+set_resp_cookie(Name, Value, Req, Opts) ->
Cookie = cow_cookie:setcookie(Name, Value, maps:to_list(Opts)),
RespCookies = maps:get(resp_cookies, Req, #{}),
Req#{resp_cookies => RespCookies#{Name => Cookie}}.