aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http.erl2
-rw-r--r--src/cowboy_websocket.erl2
-rw-r--r--src/cowboy_websocket_handler.erl3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index f3ff687..1d19838 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -123,7 +123,7 @@ cookie_list(Data, Acc) ->
(<< $,, Rest/binary >>) -> cookie_list(Rest, Acc);
(<< $;, Rest/binary >>) -> cookie_list(Rest, Acc);
(Rest) -> cookie(Rest,
- fun (Rest2, << $$, _/bits >>, _) ->
+ fun (Rest2, << $$, _/binary >>, _) ->
cookie_list(Rest2, Acc);
(Rest2, Name, Value) ->
cookie_list(Rest2, [{Name, Value}|Acc])
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index 1a87732..9bd6df6 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -256,7 +256,7 @@ websocket_data(State, Req, HandlerState, << Fin:1, _Rsv:3, Opcode:4, 1:1,
websocket_data(State, Req, HandlerState,
Opcode, Len, MaskKey, Rest, Fin);
%% When payload length is over 63 bits, the most significant bit MUST be 0.
-websocket_data(State, Req, HandlerState, << _:8, 1:1, 127:7, 1:1, _/bits >>) ->
+websocket_data(State, Req, HandlerState, << _:8, 1:1, 127:7, 1:1, _:7, _/binary >>) ->
websocket_close(State, Req, HandlerState, {error, badframe});
%% All frames sent from the client to the server are masked.
websocket_data(State, Req, HandlerState, << _:8, 0:1, _/bits >>) ->
diff --git a/src/cowboy_websocket_handler.erl b/src/cowboy_websocket_handler.erl
index bd2ed5a..8bbbc08 100644
--- a/src/cowboy_websocket_handler.erl
+++ b/src/cowboy_websocket_handler.erl
@@ -53,6 +53,9 @@
-type terminate_reason() :: {normal, shutdown}
| {normal, timeout}
| {error, closed}
+ | {remote, closed}
+ | {remote, cowboy_websocket:close_code(), binary()}
+ | {error, badencoding}
| {error, badframe}
| {error, atom()}.