mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Fix a crash in websocket_handshake when cowboy_http_req:compact/1 is used
Also add a call to compact/1 in the websocket test handler so we may catch bugs related to it faster later on.
This commit is contained in:
parent
c2be0f2073
commit
97460a5993
2 changed files with 3 additions and 2 deletions
|
@ -18,7 +18,8 @@ terminate(_Req, _State) ->
|
|||
|
||||
websocket_init(_TransportName, Req, _Opts) ->
|
||||
erlang:start_timer(1000, self(), <<"websocket_init">>),
|
||||
{ok, Req, undefined}.
|
||||
Req2 = cowboy_http_req:compact(Req),
|
||||
{ok, Req2, undefined}.
|
||||
|
||||
websocket_handle({text, Data}, Req, State) ->
|
||||
{reply, {text, Data}, Req, State};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue