aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_constraints.erl2
-rw-r--r--src/cowboy_http.erl2
-rw-r--r--src/cowboy_websocket.erl2
3 files changed, 3 insertions, 3 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),