aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_req.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_req.erl')
-rw-r--r--src/cowboy_req.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 80d68a9..08e4155 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -102,6 +102,9 @@
-export([upgrade_reply/3]).
-export([ensure_response/2]).
+%% Private setter/getter API.
+-export([set_host/4]).
+
%% Misc API.
-export([compact/1]).
-export([lock/1]).
@@ -908,6 +911,14 @@ ensure_response(#http_req{socket=Socket, transport=Transport,
Transport:send(Socket, <<"0\r\n\r\n">>),
ok.
+%% Private setter/getter API.
+
+%% @private
+-spec set_host(binary(), inet:port_number(), binary(), Req)
+ -> Req when Req::req().
+set_host(Host, Port, RawHost, Req=#http_req{headers=Headers}) ->
+ Req#http_req{host=Host, port=Port, headers=[{'Host', RawHost}|Headers]}.
+
%% Misc API.
%% @doc Compact the request data by removing all non-system information.