0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Ignore the boundary parameter when accepting multipart

This commit is contained in:
Loïc Hoguin 2018-11-14 18:03:40 +01:00
parent dba17fdddb
commit 4fedb33631
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
3 changed files with 61 additions and 20 deletions

View file

@ -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 _:_ ->