Просмотр исходного кода

Rename the type http_uri/0 to cowboy_http:uri/0

Loïc Hoguin 13 лет назад
Родитель
Сommit
314483a0b6
3 измененных файлов с 6 добавлено и 6 удалено
  1. 0 4
      include/http.hrl
  2. 5 1
      src/cowboy_http.erl
  3. 1 1
      src/cowboy_http_protocol.erl

+ 0 - 4
include/http.hrl

@@ -13,10 +13,6 @@
 %% ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 %% ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 %% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 %% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 
--type http_uri() :: '*' | {absoluteURI, http | https, Host::binary(),
-	Port::integer() | undefined, Path::binary()}
-	| {scheme, Scheme::binary(), binary()}
-	| {abs_path, binary()} | binary().
 -type http_version() :: {Major::non_neg_integer(), Minor::non_neg_integer()}.
 -type http_version() :: {Major::non_neg_integer(), Minor::non_neg_integer()}.
 -type http_header() :: 'Cache-Control' | 'Connection' | 'Date' | 'Pragma'
 -type http_header() :: 'Cache-Control' | 'Connection' | 'Date' | 'Pragma'
 	| 'Transfer-Encoding' | 'Upgrade' | 'Via' | 'Accept' | 'Accept-Charset'
 	| 'Transfer-Encoding' | 'Upgrade' | 'Via' | 'Accept' | 'Accept-Charset'

+ 5 - 1
src/cowboy_http.erl

@@ -28,8 +28,12 @@
 
 
 -type method() :: 'OPTIONS' | 'GET' | 'HEAD'
 -type method() :: 'OPTIONS' | 'GET' | 'HEAD'
 	| 'POST' | 'PUT' | 'DELETE' | 'TRACE' | binary().
 	| 'POST' | 'PUT' | 'DELETE' | 'TRACE' | binary().
+-type uri() :: '*' | {absoluteURI, http | https, Host::binary(),
+	Port::integer() | undefined, Path::binary()}
+	| {scheme, Scheme::binary(), binary()}
+	| {abs_path, binary()} | binary().
 
 
--export_type([method/0]).
+-export_type([method/0, uri/0]).
 
 
 -include("include/http.hrl").
 -include("include/http.hrl").
 -include_lib("eunit/include/eunit.hrl").
 -include_lib("eunit/include/eunit.hrl").

+ 1 - 1
src/cowboy_http_protocol.erl

@@ -108,7 +108,7 @@ wait_request(State=#state{socket=Socket, transport=Transport,
 		{error, _Reason} -> terminate(State)
 		{error, _Reason} -> terminate(State)
 	end.
 	end.
 
 
--spec request({http_request, cowboy_http:method(), http_uri(),
+-spec request({http_request, cowboy_http:method(), cowboy_http:uri(),
 	http_version()}, #state{}) -> ok | none().
 	http_version()}, #state{}) -> ok | none().
 request({http_request, _Method, _URI, Version}, State)
 request({http_request, _Method, _URI, Version}, State)
 		when Version =/= {1, 0}, Version =/= {1, 1} ->
 		when Version =/= {1, 0}, Version =/= {1, 1} ->