aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cowboy.erl3
-rw-r--r--src/cowboy_client.erl2
-rw-r--r--src/cowboy_http.erl2
-rw-r--r--src/cowboy_req.erl6
4 files changed, 7 insertions, 6 deletions
diff --git a/src/cowboy.erl b/src/cowboy.erl
index 257172d..d9e32e7 100644
--- a/src/cowboy.erl
+++ b/src/cowboy.erl
@@ -20,6 +20,9 @@
-export([stop_listener/1]).
-export([set_env/3]).
+-type http_version() :: 'HTTP/1.1' | 'HTTP/1.0'.
+-export_type([http_version/0]).
+
%% @doc Start an HTTP listener.
-spec start_http(any(), non_neg_integer(), any(), any()) -> {ok, pid()}.
start_http(Ref, NbAcceptors, TransOpts, ProtoOpts)
diff --git a/src/cowboy_client.erl b/src/cowboy_client.erl
index faee904..b5f96b3 100644
--- a/src/cowboy_client.erl
+++ b/src/cowboy_client.erl
@@ -40,7 +40,7 @@
timeout = 5000 :: timeout(), %% @todo Configurable.
buffer = <<>> :: binary(),
connection = keepalive :: keepalive | close,
- version = 'HTTP/1.1' :: cowboy_http:version(),
+ version = 'HTTP/1.1' :: cowboy:http_version(),
response_body = undefined :: undefined | non_neg_integer()
}).
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index 2da211d..5036526 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -52,11 +52,9 @@
-export([urlencode/2]).
-export([x_www_form_urlencoded/1]).
--type version() :: 'HTTP/1.1' | 'HTTP/1.0'.
-type headers() :: [{binary(), iodata()}].
-type status() :: non_neg_integer() | binary().
--export_type([version/0]).
-export_type([headers/0]).
-export_type([status/0]).
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index cc6063e..dd0e994 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -143,7 +143,7 @@
%% Request.
pid = undefined :: pid(),
method = <<"GET">> :: binary(),
- version = 'HTTP/1.1' :: cowboy_http:version(),
+ version = 'HTTP/1.1' :: cowboy:http_version(),
peer = undefined :: undefined | {inet:ip_address(), inet:port_number()},
host = undefined :: undefined | binary(),
host_info = undefined :: undefined | cowboy_router:tokens(),
@@ -192,7 +192,7 @@
-spec new(inet:socket(), module(),
undefined | {inet:ip_address(), inet:port_number()},
binary(), binary(), binary(),
- cowboy_http:version(), cowboy_http:headers(), binary(),
+ cowboy:http_version(), cowboy_http:headers(), binary(),
inet:port_number() | undefined, binary(), boolean(), boolean(),
undefined | cowboy_protocol:onresponse_fun())
-> req().
@@ -224,7 +224,7 @@ method(Req) ->
{Req#http_req.method, Req}.
%% @doc Return the HTTP version used for the request.
--spec version(Req) -> {cowboy_http:version(), Req} when Req::req().
+-spec version(Req) -> {cowboy:http_version(), Req} when Req::req().
version(Req) ->
{Req#http_req.version, Req}.