mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Fix multipart parser when the boundary is not fully read yet
This commit is contained in:
parent
d761a34380
commit
143ed80486
1 changed files with 2 additions and 2 deletions
|
@ -204,8 +204,8 @@ parse_body(Bin, Pattern = {{P, PSize}, _}) when byte_size(Bin) >= PSize ->
|
|||
%% next input onto tail of current input binary.
|
||||
{body, Bin, fun () -> parse_body(<<>>, Pattern) end};
|
||||
{BoundaryStart, Len} ->
|
||||
PBody = binary:part(Bin, BoundaryStart, Len),
|
||||
Rest = binary:part(Bin, 0, BoundaryStart),
|
||||
PBody = binary:part(Bin, 0, BoundaryStart),
|
||||
Rest = binary:part(Bin, BoundaryStart, Len),
|
||||
{body, PBody, fun () -> parse_body(Rest, Pattern) end}
|
||||
end
|
||||
end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue