aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/asterisk_h.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-12-06 14:05:30 +0100
committerLoïc Hoguin <[email protected]>2017-12-06 14:05:30 +0100
commitbc39b433bb20c44690b75bf28539983517002268 (patch)
treec335c45a92f535d2100d04f8a9df8899f459b013 /test/handlers/asterisk_h.erl
parent2eb3e3f994e464ae2678f7c3d321213e5eec9ad4 (diff)
downloadcowboy-bc39b433bb20c44690b75bf28539983517002268.tar.gz
cowboy-bc39b433bb20c44690b75bf28539983517002268.tar.bz2
cowboy-bc39b433bb20c44690b75bf28539983517002268.zip
Properly handle OPTIONS * requests
Support for these was broken during the development of Cowboy 2.0. It is now fixed and better handled than it ever was.
Diffstat (limited to 'test/handlers/asterisk_h.erl')
-rw-r--r--test/handlers/asterisk_h.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/handlers/asterisk_h.erl b/test/handlers/asterisk_h.erl
index 56b8bcb..563b488 100644
--- a/test/handlers/asterisk_h.erl
+++ b/test/handlers/asterisk_h.erl
@@ -7,6 +7,8 @@
init(Req, Opts) ->
echo(cowboy_req:header(<<"x-echo">>, Req), Req, Opts).
+echo(undefined, Req, Opts) ->
+ {ok, cowboy_req:reply(200, Req), Opts};
echo(What, Req, Opts) ->
F = binary_to_atom(What, latin1),
Value = case cowboy_req:F(Req) of