aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/input_crash_h.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/handlers/input_crash_h.erl')
-rw-r--r--test/handlers/input_crash_h.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/handlers/input_crash_h.erl b/test/handlers/input_crash_h.erl
new file mode 100644
index 0000000..668d053
--- /dev/null
+++ b/test/handlers/input_crash_h.erl
@@ -0,0 +1,10 @@
+%% This module crashes on request input data
+%% depending on the given option.
+
+-module(input_crash_h).
+
+-export([init/3]).
+
+init(_, Req, content_length) ->
+ cowboy_error_h:ignore(cow_http_hd, number, 2),
+ cowboy_req:parse_header(<<"content-length">>, Req).