aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-10-06 01:07:49 +0200
committerLoïc Hoguin <[email protected]>2011-10-06 01:07:49 +0200
commit97460a599377eab084ffe99588b2c24bab23c27d (patch)
tree6cff09da6e5cd0b5a67a359a0a95300689a216df /test
parentc2be0f20736bf3867b044e2f2bf6eb4fb862daf1 (diff)
downloadcowboy-97460a599377eab084ffe99588b2c24bab23c27d.tar.gz
cowboy-97460a599377eab084ffe99588b2c24bab23c27d.tar.bz2
cowboy-97460a599377eab084ffe99588b2c24bab23c27d.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/websocket_handler.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/websocket_handler.erl b/test/websocket_handler.erl
index 4ba2a67..0cfc8f3 100644
--- a/test/websocket_handler.erl
+++ b/test/websocket_handler.erl
@@ -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};