aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE_data
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-08-10 15:09:04 +0200
committerLoïc Hoguin <[email protected]>2016-08-10 15:09:04 +0200
commitaa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac (patch)
tree591db3bbed44577d9b87e8d07dde7454ce862207 /test/http_SUITE_data
parentae95e87eb1c352b96b43a431fd4693d7d80a4b64 (diff)
downloadcowboy-aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac.tar.gz
cowboy-aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac.tar.bz2
cowboy-aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac.zip
Update the multipart reading interface
Now named read_part/read_part_body, with a verb indicating action.
Diffstat (limited to 'test/http_SUITE_data')
-rw-r--r--test/http_SUITE_data/http_multipart.erl4
-rw-r--r--test/http_SUITE_data/http_multipart_stream.erl4
2 files changed, 4 insertions, 4 deletions
diff --git a/test/http_SUITE_data/http_multipart.erl b/test/http_SUITE_data/http_multipart.erl
index 212f569..5a4c6be 100644
--- a/test/http_SUITE_data/http_multipart.erl
+++ b/test/http_SUITE_data/http_multipart.erl
@@ -9,9 +9,9 @@ init(Req, Opts) ->
{ok, cowboy_req:reply(200, #{}, term_to_binary(Result), Req2), Opts}.
acc_multipart(Req, Acc) ->
- case cowboy_req:part(Req) of
+ case cowboy_req:read_part(Req) of
{ok, Headers, Req2} ->
- {ok, Body, Req3} = cowboy_req:part_body(Req2),
+ {ok, Body, Req3} = cowboy_req:read_part_body(Req2),
acc_multipart(Req3, [{Headers, Body}|Acc]);
{done, Req2} ->
{lists:reverse(Acc), Req2}
diff --git a/test/http_SUITE_data/http_multipart_stream.erl b/test/http_SUITE_data/http_multipart_stream.erl
index 82662ad..b739740 100644
--- a/test/http_SUITE_data/http_multipart_stream.erl
+++ b/test/http_SUITE_data/http_multipart_stream.erl
@@ -9,7 +9,7 @@ init(Req, Opts) ->
{ok, cowboy_req:reply(200, Req2), Opts}.
multipart(Req) ->
- case cowboy_req:part(Req) of
+ case cowboy_req:read_part(Req) of
{ok, [{<<"content-length">>, BinLength}], Req2} ->
Length = list_to_integer(binary_to_list(BinLength)),
{Length, Req3} = stream_body(Req2, 0),
@@ -19,7 +19,7 @@ multipart(Req) ->
end.
stream_body(Req, N) ->
- case cowboy_req:part_body(Req) of
+ case cowboy_req:read_part_body(Req) of
{ok, Data, Req2} ->
{N + byte_size(Data), Req2};
{more, Data, Req2} ->