aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/ws_reject_h.erl
diff options
context:
space:
mode:
authorPiotr Bober <[email protected]>2018-12-17 15:27:48 +0100
committerLoïc Hoguin <[email protected]>2018-12-31 14:28:09 +0100
commit32779615616fe3ae052eef94d838ecc9180045a7 (patch)
treea5421656726e8d0df94261dd42c4f77fa741d956 /test/handlers/ws_reject_h.erl
parentf8df52d6a5bf201cc6c5f706a5e886894947e108 (diff)
downloadgun-32779615616fe3ae052eef94d838ecc9180045a7.tar.gz
gun-32779615616fe3ae052eef94d838ecc9180045a7.tar.bz2
gun-32779615616fe3ae052eef94d838ecc9180045a7.zip
Fix stripping stream reference in gun_http
An invalid stream reference (the websocket tuple wrapper) was sent in the gun_data message. Also moves autobahn to its own test suite.
Diffstat (limited to 'test/handlers/ws_reject_h.erl')
-rw-r--r--test/handlers/ws_reject_h.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/handlers/ws_reject_h.erl b/test/handlers/ws_reject_h.erl
new file mode 100644
index 0000000..c58e672
--- /dev/null
+++ b/test/handlers/ws_reject_h.erl
@@ -0,0 +1,7 @@
+%% This handler rejects all Websocket connections.
+-module(ws_reject_h).
+
+-export([init/2]).
+
+init(Req0, Env) ->
+ {ok, cowboy_req:reply(400, #{}, <<"Upgrade rejected">>, Req0), Env}.