mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Move cowboy_http:version() to cowboy:http_version()
This commit is contained in:
parent
ba7e6c07ec
commit
c0c333e41b
4 changed files with 7 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
}).
|
||||
|
||||
|
|
|
@ -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]).
|
||||
|
||||
|
|
|
@ -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}.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue