aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_req.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-08-30 23:11:24 +0200
committerLoïc Hoguin <[email protected]>2012-09-10 12:25:57 +0200
commit6fa734b487102ed1436fd61598d51817a46a9b75 (patch)
tree1f5f57e3d0ea566fd355fdd915d9b4706a9c2233 /src/cowboy_req.erl
parente17e18668d8645eaffe4da64a63e3162c99fe2d3 (diff)
downloadcowboy-6fa734b487102ed1436fd61598d51817a46a9b75.tar.gz
cowboy-6fa734b487102ed1436fd61598d51817a46a9b75.tar.bz2
cowboy-6fa734b487102ed1436fd61598d51817a46a9b75.zip
Replace cowboy_req:host/1 with cowboy_req:raw_host/1
The latter is much more useful than the former, which ends up being removed.
Diffstat (limited to 'src/cowboy_req.erl')
-rw-r--r--src/cowboy_req.erl14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 5bb9fc5..54693f7 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -28,7 +28,6 @@
-export([peer_addr/1]).
-export([host/1]).
-export([host_info/1]).
--export([raw_host/1]).
-export([port/1]).
-export([path/1]).
-export([path_info/1]).
@@ -131,8 +130,8 @@ peer_addr(Req = #http_req{}) ->
end,
{PeerAddr, Req3}.
-%% @doc Return the tokens for the hostname requested.
--spec host(Req) -> {cowboy_dispatcher:tokens(), Req} when Req::req().
+%% @doc Return the host binary string.
+-spec host(Req) -> {binary(), Req} when Req::req().
host(Req) ->
{Req#http_req.host, Req}.
@@ -143,11 +142,6 @@ host(Req) ->
host_info(Req) ->
{Req#http_req.host_info, Req}.
-%% @doc Return the raw host directly taken from the request.
--spec raw_host(Req) -> {binary(), Req} when Req::req().
-raw_host(Req) ->
- {Req#http_req.raw_host, Req}.
-
%% @doc Return the port used for this request.
-spec port(Req) -> {inet:port_number(), Req} when Req::req().
port(Req) ->
@@ -826,12 +820,12 @@ upgrade_reply(Status, Headers, Req=#http_req{
%% @doc Compact the request data by removing all non-system information.
%%
-%% This essentially removes the host, path, query string, bindings and headers.
+%% This essentially removes the path, query string, bindings and headers.
%% Use it when you really need to save up memory, for example when having
%% many concurrent long-running connections.
-spec compact(Req) -> Req when Req::req().
compact(Req) ->
- Req#http_req{host=undefined, host_info=undefined, path=undefined,
+ Req#http_req{host_info=undefined, path=undefined,
path_info=undefined, qs_vals=undefined,
bindings=undefined, headers=[],
p_headers=[], cookies=[]}.