From 9b76ea47ff48a92ca295c40301c9620c2e12026a Mon Sep 17 00:00:00 2001 From: seanmcevoy Date: Mon, 29 Jun 2015 21:09:28 +0100 Subject: [PATCH 1/5] tweaks due to issues in EE POC --- src/webmachine_multipart.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/webmachine_multipart.erl b/src/webmachine_multipart.erl index f7b87903..f2a21482 100644 --- a/src/webmachine_multipart.erl +++ b/src/webmachine_multipart.erl @@ -51,6 +51,8 @@ find_boundary(ReqData) -> % @doc Turn a multipart form into component parts. % @spec get_all_parts(incoming_req_body(), boundary()) -> [fpart()] +get_all_parts(Body, Boundary) when is_list(Body), is_list(Boundary) -> + get_all_parts(list_to_binary(Body), Boundary); get_all_parts(Body, Boundary) when is_binary(Body), is_list(Boundary) -> StreamStruct = send_streamed_body(Body,1024), getparts1(stream_parts(StreamStruct, Boundary), []). @@ -71,6 +73,8 @@ stream_form({Hunk, Next}, Boundary, []) -> stream_form(get_more_data(Next), Boundary, re:split(Hunk, Boundary,[])); stream_form({Hunk, Next}, Boundary, [<<>>|DQ]) -> stream_form({Hunk, Next}, Boundary, DQ); +stream_form({Hunk, Next}, Boundary, [<<"\r\n">>|DQ]) -> + stream_form({Hunk, Next}, Boundary, DQ); stream_form({Hunk, Next}, Boundary, [H|[T1|T2]]) -> {make_part(H), fun() -> stream_form({Hunk, Next}, Boundary, [T1|T2]) end}; @@ -94,7 +98,7 @@ stream_parts([H|T]) -> {make_part(H), fun() -> stream_parts(T) end}. get_more_data(done) -> {<<"--\n">>, really_done}; get_more_data(Fun) -> Fun(). - + make_part(PartData) -> %% Remove the trailing \r\n [HeadData, BodyWithCRLF] = re:split(PartData, "\\r\\n\\r\\n", [{parts,2}]), From 0939c28e7a19006e0addfe7c7b1f84e25d04f6dd Mon Sep 17 00:00:00 2001 From: Nick Marino Date: Wed, 24 Feb 2016 15:26:36 -0500 Subject: [PATCH 2/5] Bump mochiweb version to 2.9.0p2 This pulls in the fix for the spurious 400 errors. --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 31447de1..8e5147e9 100644 --- a/rebar.config +++ b/rebar.config @@ -6,7 +6,7 @@ {xref_checks, [undefined_function_calls]}. {deps, - [{mochiweb, "2.9.0", {git, "git://github.com/basho/mochiweb.git", {tag, "v2.9.0p1"}}} + [{mochiweb, "2.9.0.*", {git, "git://github.com/basho/mochiweb.git", {tag, "v2.9.0p2"}}} ]}. {dev_only_deps, From e5215d9a070bc510ccd0cb8d15f71097aa53d3b0 Mon Sep 17 00:00:00 2001 From: Ted Burghart Date: Thu, 17 Mar 2016 11:33:39 -0400 Subject: [PATCH 3/5] change otp version check to accommodate patched R15B01 releases If the string returned by erlang:system_info(otp_release) begins with R15B01 but has any suffix the previous version check would erroneously assume that it supported APIs introduced in R15B02. This is pretty obscure and unlikely to be relevant to most anyone any more, but it can bite painfully in certain regression testing scenarios. --- rebar.config.script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config.script b/rebar.config.script index be5bcac1..7a3c21f3 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -1,7 +1,7 @@ %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et OtpVersion = erlang:system_info(otp_release), -Config1 = case hd(OtpVersion) =:= $R andalso OtpVersion =< "R15B01" of +Config1 = case hd(OtpVersion) =:= $R andalso OtpVersion < "R15B02" of true -> HashDefine = [{d,old_hash}], case lists:keysearch(erl_opts, 1, CONFIG) of From 39ced3433b8bc489bde2f0fb4752edce686d53b0 Mon Sep 17 00:00:00 2001 From: Brett Hazen Date: Tue, 11 Oct 2016 10:39:54 -0600 Subject: [PATCH 4/5] Set the ibrowse version to v4.3 --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 8e5147e9..49ba7099 100644 --- a/rebar.config +++ b/rebar.config @@ -11,5 +11,5 @@ {dev_only_deps, [{meck, "0.8.*", {git, "git://github.com/basho/meck.git", {tag, "0.8.2"}}}, - {ibrowse, "4.0.2", {git, "git://github.com/cmullaparthi/ibrowse.git", {tag, "v4.0.2"}}} + {ibrowse, "4.*", {git, "git://github.com/basho/ibrowse.git", {tag, "v4.3"}}} ]}. From 0f9bb7bd9d456ede783983859ac22b95e6b1ec32 Mon Sep 17 00:00:00 2001 From: Korry Clark Date: Thu, 22 Dec 2016 13:25:50 -0800 Subject: [PATCH 5/5] use https to pull deps --- demo/rebar.config | 4 ++-- priv/templates/rebar.config | 2 +- rebar.config | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demo/rebar.config b/demo/rebar.config index d6c7cbe7..fbcab168 100644 --- a/demo/rebar.config +++ b/demo/rebar.config @@ -1,6 +1,6 @@ %%-*- mode: erlang -*- {deps, [ - {webmachine, "1.10.*", {git, "git://github.com/basho/webmachine", "HEAD"}}, - {erlydtl, ".*", {git, "git://github.com/evanmiller/erlydtl", "HEAD"}} + {webmachine, "1.10.*", {git, "https://github.com/basho/webmachine", "HEAD"}}, + {erlydtl, ".*", {git, "https://github.com/evanmiller/erlydtl", "HEAD"}} ]}. diff --git a/priv/templates/rebar.config b/priv/templates/rebar.config index d245b800..909e60e6 100644 --- a/priv/templates/rebar.config +++ b/priv/templates/rebar.config @@ -1,3 +1,3 @@ %%-*- mode: erlang -*- -{deps, [{webmachine, "1.10.*", {git, "git://github.com/basho/webmachine", "HEAD"}}]}. +{deps, [{webmachine, "1.10.*", {git, "https://github.com/basho/webmachine", "HEAD"}}]}. diff --git a/rebar.config b/rebar.config index 49ba7099..ae346e6a 100644 --- a/rebar.config +++ b/rebar.config @@ -6,10 +6,10 @@ {xref_checks, [undefined_function_calls]}. {deps, - [{mochiweb, "2.9.0.*", {git, "git://github.com/basho/mochiweb.git", {tag, "v2.9.0p2"}}} + [{mochiweb, "2.9.0.*", {git, "https://github.com/basho/mochiweb.git", {tag, "v2.9.0p2"}}} ]}. {dev_only_deps, - [{meck, "0.8.*", {git, "git://github.com/basho/meck.git", {tag, "0.8.2"}}}, - {ibrowse, "4.*", {git, "git://github.com/basho/ibrowse.git", {tag, "v4.3"}}} + [{meck, "0.8.*", {git, "https://github.com/basho/meck.git", {tag, "0.8.2"}}}, + {ibrowse, "4.*", {git, "https://github.com/basho/ibrowse.git", {tag, "v4.3"}}} ]}.