aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-14 18:03:40 +0100
committerLoïc Hoguin <[email protected]>2018-11-14 18:04:32 +0100
commit4fedb336311604253153eafe81f33a77b44a0b2f (patch)
tree9e2f0093715e4694dad3a48507310ba79a3f49f3 /test/handlers
parentdba17fdddb2d0a7a832afb9480ec6515a38a15d7 (diff)
downloadcowboy-4fedb336311604253153eafe81f33a77b44a0b2f.tar.gz
cowboy-4fedb336311604253153eafe81f33a77b44a0b2f.tar.bz2
cowboy-4fedb336311604253153eafe81f33a77b44a0b2f.zip
Ignore the boundary parameter when accepting multipart
Diffstat (limited to 'test/handlers')
-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}.