Commits

Anonymous committed 90d2a36

properly handle stream boundary

  • Participants
  • Parent commits 77bb57c
  • Tags webmachine-1.3

Comments (0)

Files changed (1)

src/webmachine_multipart.erl

 % @spec stream_parts(wm_stream(), boundary()) ->
 %                                    'done_parts' | {fpart(), function()}
 stream_parts(StreamStruct, Boundary) ->
-    stream_form(StreamStruct, Boundary, []).
+    stream_form(StreamStruct, "--" ++ Boundary, []).
 
 stream_form(_, _, [<<"----\n">>|_]) -> done_parts;
 stream_form(_, _, [<<"--\n">>|_]) -> done_parts;
 % browsers are fun, and terminate posts slightly differently from each other:
 stream_parts([<<"----\n">>]) -> done_parts;
 stream_parts([<<"--\n">>]) -> done_parts;
+stream_parts([<<"----\r\n">>]) -> done_parts;
+stream_parts([<<"--\r\n">>]) -> done_parts;
 stream_parts([<<"--\r\n--\n">>]) -> done_parts;
 stream_parts([<<"--\r\n--\r\n">>]) -> done_parts;
 stream_parts([H|T]) -> {make_part(H), fun() -> stream_parts(T) end}.