aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cowboy_constraints.erl2
-rw-r--r--src/cowboy_http.erl2
-rw-r--r--src/cowboy_websocket.erl2
-rw-r--r--test/http_SUITE_data/http_multipart_stream.erl2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/cowboy_constraints.erl b/src/cowboy_constraints.erl
index 9a379e1..9bd578e 100644
--- a/src/cowboy_constraints.erl
+++ b/src/cowboy_constraints.erl
@@ -52,7 +52,7 @@ apply_constraint(Value, F) when is_function(F) ->
%% Constraint functions.
int(Value) when is_binary(Value) ->
- try {true, list_to_integer(binary_to_list(Value))}
+ try {true, binary_to_integer(Value)}
catch _:_ -> false
end.
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index 773f891..5ec7d0e 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -578,7 +578,7 @@ parse_host(<< $[, Rest/bits >>, false, <<>>) ->
parse_host(<<>>, false, Acc) ->
{Acc, undefined};
parse_host(<< $:, Rest/bits >>, false, Acc) ->
- {Acc, list_to_integer(binary_to_list(Rest))};
+ {Acc, binary_to_integer(Rest)};
parse_host(<< $], Rest/bits >>, true, Acc) ->
parse_host(Rest, false, << Acc/binary, $] >>);
parse_host(<< C, Rest/bits >>, E, Acc) ->
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index 603889f..693a920 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -91,7 +91,7 @@ websocket_upgrade(State, Req) ->
%% @todo Should probably send a 426 if the Upgrade header is missing.
[<<"websocket">>] = cowboy_req:parse_header(<<"upgrade">>, Req),
Version = cowboy_req:header(<<"sec-websocket-version">>, Req),
- IntVersion = list_to_integer(binary_to_list(Version)),
+ IntVersion = binary_to_integer(Version),
true = (IntVersion =:= 7) orelse (IntVersion =:= 8)
orelse (IntVersion =:= 13),
Key = cowboy_req:header(<<"sec-websocket-key">>, Req),
diff --git a/test/http_SUITE_data/http_multipart_stream.erl b/test/http_SUITE_data/http_multipart_stream.erl
index b739740..88cf611 100644
--- a/test/http_SUITE_data/http_multipart_stream.erl
+++ b/test/http_SUITE_data/http_multipart_stream.erl
@@ -11,7 +11,7 @@ init(Req, Opts) ->
multipart(Req) ->
case cowboy_req:read_part(Req) of
{ok, [{<<"content-length">>, BinLength}], Req2} ->
- Length = list_to_integer(binary_to_list(BinLength)),
+ Length = binary_to_integer(BinLength),
{Length, Req3} = stream_body(Req2, 0),
multipart(Req3);
{done, Req2} ->