aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/content_types_accepted_h.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/handlers/content_types_accepted_h.erl')
-rw-r--r--test/handlers/content_types_accepted_h.erl23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/handlers/content_types_accepted_h.erl b/test/handlers/content_types_accepted_h.erl
new file mode 100644
index 0000000..7aec1bb
--- /dev/null
+++ b/test/handlers/content_types_accepted_h.erl
@@ -0,0 +1,23 @@
+%% This module accepts a multipart media type with parameters
+%% that do not include boundary.
+
+-module(content_types_accepted_h).
+
+-export([init/2]).
+-export([allowed_methods/2]).
+-export([content_types_accepted/2]).
+-export([put_multipart_mixed/2]).
+
+init(Req, Opts) ->
+ {cowboy_rest, Req, Opts}.
+
+allowed_methods(Req, State) ->
+ {[<<"PUT">>], Req, State}.
+
+content_types_accepted(Req=#{qs := <<"multipart">>}, State) ->
+ {[
+ {{<<"multipart">>, <<"mixed">>, [{<<"v">>, <<"1">>}]}, put_multipart_mixed}
+ ], Req, State}.
+
+put_multipart_mixed(Req, State) ->
+ {true, Req, State}.