0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00

Drop R15 support

This commit is contained in:
Loïc Hoguin 2014-07-12 14:19:29 +02:00
parent de4697690c
commit e2b5c21443
7 changed files with 11 additions and 17 deletions

View file

@ -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 -> [];