aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-06-09 16:57:11 +0200
committerLoïc Hoguin <[email protected]>2017-06-09 16:57:11 +0200
commitec00e3d60e985e00c6b425434af5017c634801db (patch)
tree52a94d91613704264935aa424330df71d47120b9 /test
parent6f7b59886ec17027b16ed4d10737452e17f233d0 (diff)
downloadcowboy-ec00e3d60e985e00c6b425434af5017c634801db.tar.gz
cowboy-ec00e3d60e985e00c6b425434af5017c634801db.tar.bz2
cowboy-ec00e3d60e985e00c6b425434af5017c634801db.zip
Make cowboy_req:read_part return multipart headers as map
Diffstat (limited to 'test')
-rw-r--r--test/req_SUITE.erl22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/req_SUITE.erl b/test/req_SUITE.erl
index a2c040e..d155aa8 100644
--- a/test/req_SUITE.erl
+++ b/test/req_SUITE.erl
@@ -399,14 +399,13 @@ do_multipart(Path, Config) ->
{<<"content-type">>, <<"multipart/mixed; boundary=deadbeef">>}
], ReqBody, Config),
[
- {[{<<"content-type">>, <<"text/plain">>}], <<"Cowboy is an HTTP server.">>},
+ {#{<<"content-type">> := <<"text/plain">>}, <<"Cowboy is an HTTP server.">>},
{LargeHeaders, LargeBody}
] = binary_to_term(RespBody),
- %% @todo Multipart header order is currently undefined.
- [
- {<<"content-type">>, <<"application/octet-stream">>},
- {<<"x-custom">>, <<"value">>}
- ] = lists:sort(LargeHeaders),
+ #{
+ <<"content-type">> := <<"application/octet-stream">>,
+ <<"x-custom">> := <<"value">>
+ } = LargeHeaders,
ok.
read_part_skip_body(Config) ->
@@ -421,14 +420,13 @@ read_part_skip_body(Config) ->
{<<"content-type">>, <<"multipart/mixed; boundary=deadbeef">>}
], ReqBody, Config),
[
- [{<<"content-type">>, <<"text/plain">>}],
+ #{<<"content-type">> := <<"text/plain">>},
LargeHeaders
] = binary_to_term(RespBody),
- %% @todo Multipart header order is currently undefined.
- [
- {<<"content-type">>, <<"application/octet-stream">>},
- {<<"x-custom">>, <<"value">>}
- ] = lists:sort(LargeHeaders),
+ #{
+ <<"content-type">> := <<"application/octet-stream">>,
+ <<"x-custom">> := <<"value">>
+ } = LargeHeaders,
ok.
%% @todo When reading a multipart body, length and period