mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 12:40:25 +00:00
Use binary_to_integer instead of to list and back
This commit is contained in:
parent
9966df9ad4
commit
83aa3f1b9c
4 changed files with 4 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue