From 4fedb336311604253153eafe81f33a77b44a0b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 14 Nov 2018 18:03:40 +0100 Subject: Ignore the boundary parameter when accepting multipart --- src/cowboy_rest.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index 606f47f..76eda79 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -1060,6 +1060,10 @@ accept_resource(Req, State) -> {CTA, Req2, State2} -> CTA2 = [normalize_content_types(P) || P <- CTA], try cowboy_req:parse_header(<<"content-type">>, Req2) of + %% We do not match against the boundary parameter for multipart. + {Type = <<"multipart">>, SubType, Params} -> + ContentType = {Type, SubType, lists:keydelete(<<"boundary">>, 1, Params)}, + choose_content_type(Req2, State2, ContentType, CTA2); ContentType -> choose_content_type(Req2, State2, ContentType, CTA2) catch _:_ -> -- cgit v1.2.3