Skip to content

Commit 1a95393

Browse files
authored
Merge pull request #3 from kongo2002/deprecated_crypto_sha
Replace deprecated crypto:sha
2 parents 6933886 + e52a746 commit 1a95393

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ cache:
99
directories:
1010
- $HOME/.cache/rebar3/
1111
otp_release:
12+
- 21.0
13+
- 20.2
1214
- 19.3
1315
- 19.0
1416
- 18.3

src/elli_ws_protocol.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ handler_init(State=#state{env=Env, handler=Handler}, Req, HandlerOpts) ->
185185
%% | {suspend, module(), atom(), [any()]}
186186
%% when Req::elli_ws_request_adapter:req().
187187
websocket_handshake(State=#state{key=Key, deflate_frame=DeflateFrame, handler=Handler}, Req, HandlerState) ->
188-
%% @todo Change into crypto:hash/2 for R17B+ or when supporting only R16B+.
189-
Challenge = base64:encode(crypto:sha(
188+
Challenge = base64:encode(crypto:hash(sha,
190189
<< Key/binary, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" >>)),
191190
Extensions = case DeflateFrame of
192191
false -> [];

src/elli_ws_request_adapter.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ websocket_handler_init(#req_adapter{req=Req}=RA, Handler, HandlerOpts) ->
208208
HandlerState :: any(),
209209
Result :: {ok, req(), any()} |
210210
{ok, req(), any(), hibernate} |
211-
{reply, elli_websocket:payload(), req(), any()} |
212-
{reply, elli_websocket:payload(), hibernate, req(), any()} |
211+
{reply, elli_ws_protocol:frame() | [elli_ws_protocol:frame()],
212+
req(), any()} |
213+
{reply, elli_ws_protocol:frame() | [elli_ws_protocol:frame()],
214+
req(), any(), hibernate} |
213215
{shutdown, req(), any()}.
214216
websocket_handler_callback(#req_adapter{req=Req}=RA, Handler, Callback, Message, HandlerState) ->
215217
case Handler:Callback(Req, Message, HandlerState) of

0 commit comments

Comments
 (0)