aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_req.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-17 00:21:33 +0200
committerLoïc Hoguin <[email protected]>2012-09-17 13:57:28 +0200
commitfc02b7f767516116167fb98b28d69805e48dbd23 (patch)
tree6bd0e7d822b3ac5a6f1401e54f7c1c53a06916ed /src/cowboy_req.erl
parent905083a7fddcc7680405c504a646da9a70e3059e (diff)
downloadcowboy-fc02b7f767516116167fb98b28d69805e48dbd23.tar.gz
cowboy-fc02b7f767516116167fb98b28d69805e48dbd23.tar.bz2
cowboy-fc02b7f767516116167fb98b28d69805e48dbd23.zip
Add the private add_header/3 function used by cowboy_protocol
Diffstat (limited to 'src/cowboy_req.erl')
-rw-r--r--src/cowboy_req.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 8653efe..d074efa 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -105,6 +105,7 @@
%% Private setter/getter API.
-export([set_host/4]).
-export([set_connection/2]).
+-export([add_header/3]).
%% Misc API.
-export([compact/1]).
@@ -928,6 +929,12 @@ set_connection(RawConnection, Req=#http_req{headers=Headers}) ->
ConnAtom = cowboy_http:connection_to_atom(ConnTokens),
Req3#http_req{connection=ConnAtom}.
+%% @private
+-spec add_header(cowboy_http:header(), binary(), Req)
+ -> Req when Req::req().
+add_header(Name, Value, Req=#http_req{headers=Headers}) ->
+ Req#http_req{headers=[{Name, Value}|Headers]}.
+
%% Misc API.
%% @doc Compact the request data by removing all non-system information.