diff options
-rw-r--r-- | src/cowboy_multipart.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_multipart.erl b/src/cowboy_multipart.erl index 83c41a8..7363054 100644 --- a/src/cowboy_multipart.erl +++ b/src/cowboy_multipart.erl @@ -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; |