mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Update multipart.asciidoc
For reading a multipart message where the part is a file :- this line below leads to a badmap error after the last chunk has been read. So the functionality isn't affected but it just throws an error at the very end. `Req = case cow_multipart:form_data(Headers) of` Removing the pattern matching and replacing it with just `case cow_multipart:form_data(Headers) of` resolves the issue. Doing this means the recursive call `multipart(Req)` should be replaced with `multipart(Req1)`.
This commit is contained in:
parent
2a08250499
commit
d4ed99b747
1 changed files with 2 additions and 2 deletions
|
@ -98,14 +98,14 @@ part is a file:
|
|||
multipart(Req0) ->
|
||||
case cowboy_req:read_part(Req0) of
|
||||
{ok, Headers, Req1} ->
|
||||
Req = case cow_multipart:form_data(Headers) of
|
||||
case cow_multipart:form_data(Headers) of
|
||||
{data, _FieldName} ->
|
||||
{ok, _Body, Req2} = cowboy_req:read_part_body(Req1),
|
||||
Req2;
|
||||
{file, _FieldName, _Filename, _CType} ->
|
||||
stream_file(Req1)
|
||||
end,
|
||||
multipart(Req);
|
||||
multipart(Req1);
|
||||
{done, Req} ->
|
||||
Req
|
||||
end.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue