aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_websocket.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_websocket.erl')
-rw-r--r--src/cowboy_websocket.erl9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index d13441d..c0f94c4 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -17,10 +17,6 @@
-module(cowboy_websocket).
-behaviour(cowboy_sub_protocol).
-%% Ignore the deprecation warning for crypto:sha/1.
-%% @todo Remove when we support only R16B+.
--compile(nowarn_deprecated_function).
-
-export([upgrade/4]).
-export([handler_loop/4]).
@@ -74,7 +70,7 @@ upgrade(Req, Env, Handler, HandlerOpts) ->
receive
{cowboy_req, resp_sent} -> ok
after 0 ->
- cowboy_req:reply(400, Req),
+ _ = cowboy_req:reply(400, Req),
exit(normal)
end
end.
@@ -166,8 +162,7 @@ handler_init(State=#state{env=Env, transport=Transport,
websocket_handshake(State=#state{
transport=Transport, key=Key, deflate_frame=DeflateFrame},
Req, HandlerState) ->
- %% @todo Change into crypto:hash/2 for R17B+ or when supporting only R16B+.
- Challenge = base64:encode(crypto:sha(
+ Challenge = base64:encode(crypto:hash(sha,
<< Key/binary, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" >>)),
Extensions = case DeflateFrame of
false -> [];