0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Change some module calls to local function calls

This commit is contained in:
Loïc Hoguin 2013-05-15 14:46:24 +02:00
parent 6e33274c85
commit 517a31086b
2 changed files with 5 additions and 5 deletions

2
erlang.mk vendored
View file

@ -116,7 +116,7 @@ CT_SUITES ?=
CT_SUITES_FULL = $(addsuffix _SUITE,$(CT_SUITES))
tests: ERLC_OPTS += -DTEST=1 +'{parse_transform, eunit_autoexport}'
tests: clean clean-deps deps app build-tests
tests: clean deps app build-tests
@mkdir -p logs/
@$(CT_RUN) -suite $(CT_SUITES_FULL)
$(gen_verbose) rm -f test/*.beam

View file

@ -802,7 +802,7 @@ qvalue(Data, Fun, Q, _M) ->
%% Only Basic authorization is supported so far.
-spec authorization(binary(), binary()) -> {binary(), any()} | {error, badarg}.
authorization(UserPass, Type = <<"basic">>) ->
cowboy_http:whitespace(UserPass,
whitespace(UserPass,
fun(D) ->
authorization_basic_userid(base64:mime_decode(D),
fun(Rest, Userid) ->
@ -813,7 +813,7 @@ authorization(UserPass, Type = <<"basic">>) ->
end)
end);
authorization(String, Type) ->
cowboy_http:whitespace(String, fun(Rest) -> {Type, Rest} end).
whitespace(String, fun(Rest) -> {Type, Rest} end).
%% @doc Parse user credentials.
-spec authorization_basic_userid(binary(), fun()) -> any().
@ -849,12 +849,12 @@ authorization_basic_password(<<C, Rest/binary>>, Fun, Acc) ->
Unit :: binary(),
Range :: {non_neg_integer(), non_neg_integer() | infinity} | neg_integer().
range(Data) ->
cowboy_http:token_ci(Data, fun range/2).
token_ci(Data, fun range/2).
range(Data, Token) ->
whitespace(Data,
fun(<<"=", Rest/binary>>) ->
case cowboy_http:list(Rest, fun range_beginning/2) of
case list(Rest, fun range_beginning/2) of
{error, badarg} ->
{error, badarg};
Ranges ->