aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_websocket.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-07-12 14:19:29 +0200
committerLoïc Hoguin <[email protected]>2014-07-12 14:19:29 +0200
commite2b5c21443a53b3bc98c90e41b8ccf08d5731db7 (patch)
treef6e85ceb5819a8cbfd36e7f8b77980680095cff5 /src/cowboy_websocket.erl
parentde4697690c5bee8349ff80f84b2393fd698c7d39 (diff)
downloadcowboy-e2b5c21443a53b3bc98c90e41b8ccf08d5731db7.tar.gz
cowboy-e2b5c21443a53b3bc98c90e41b8ccf08d5731db7.tar.bz2
cowboy-e2b5c21443a53b3bc98c90e41b8ccf08d5731db7.zip
Drop R15 support
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 -> [];