Browse Source

Merge branch 'master' of git://github.com/Menirad/cowboy

Loïc Hoguin 12 years ago
parent
commit
06ab46c868
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/cowboy_multipart.erl

+ 2 - 2
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.
 					%% next input onto tail of current input binary.
 					{body, Bin, fun () -> parse_body(<<>>, Pattern) end};
 					{body, Bin, fun () -> parse_body(<<>>, Pattern) end};
 				{BoundaryStart, Len} ->
 				{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}
 					{body, PBody, fun () -> parse_body(Rest, Pattern) end}
 			end
 			end
 	end;
 	end;