From 8a12d520b0913c328cf8d03ca27f40c64a0fc93f Mon Sep 17 00:00:00 2001 From: Jordan Wilberding Date: Tue, 6 May 2014 14:21:17 +0200 Subject: [PATCH 1/2] Update to use latest meck --- rebar.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rebar.config b/rebar.config index 128e8a67..40c03f1b 100644 --- a/rebar.config +++ b/rebar.config @@ -6,8 +6,8 @@ {deps, [{mochiweb, "1.5.1*", {git, "git://github.com/basho/mochiweb", {tag, "1.5.1p6"}}}, - {meck, "0.7.2", {git, "git://github.com/eproxus/meck.git", - {tag, "0.7.2-56-g8433cf2"}}}, + {meck, "0.8.2", {git, "git://github.com/eproxus/meck.git", + {tag, "0.8.2"}}}, {ibrowse, "4.0.1", {git, "git://github.com/cmullaparthi/ibrowse.git", {tag, "v4.0.1"}}} ]}. From 0fc9896c94ac6bcdc11ad72c0a9acd5bd3a55764 Mon Sep 17 00:00:00 2001 From: Jordan Wilberding Date: Tue, 6 May 2014 14:26:51 +0200 Subject: [PATCH 2/2] Updated to use latest crypto and fix deprecation warnings --- src/webmachine_decision_core.erl | 8 ++++---- test/decision_core_test.erl | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/webmachine_decision_core.erl b/src/webmachine_decision_core.erl index 194c48db..e5d42244 100644 --- a/src/webmachine_decision_core.erl +++ b/src/webmachine_decision_core.erl @@ -736,16 +736,16 @@ md5_final(Ctx) -> crypto:hash_final(Ctx). -else. md5(Bin) -> - crypto:md5(Bin). + crypto:hash(md5, Bin). md5_init() -> - crypto:md5_init(). + crypto:init(md5). md5_update(Ctx, Bin) -> - crypto:md5_update(Ctx, Bin). + crypto:hash_update(Ctx, Bin). md5_final(Ctx) -> - crypto:md5_final(Ctx). + crypto:hash_final(Ctx). -endif. diff --git a/test/decision_core_test.erl b/test/decision_core_test.erl index 08e42475..b650e6c5 100644 --- a/test/decision_core_test.erl +++ b/test/decision_core_test.erl @@ -642,7 +642,7 @@ content_md5_valid_b9a() -> ContentType = "text/plain", put_setting(content_types_accepted, [{ContentType, to_html}]), Body = "foo", - MD5Sum = base64:encode_to_string(crypto:md5(Body)), + MD5Sum = base64:encode_to_string(crypto:hash(md5, Body)), Headers = [{"Content-MD5", MD5Sum}], PutRequest = {url("new"), Headers, ContentType, Body}, {ok, Result} = httpc:request(put, PutRequest, [], []), @@ -659,7 +659,7 @@ content_md5_valid_b9a_validated() -> ContentType = "text/plain", put_setting(content_types_accepted, [{ContentType, to_html}]), Body = "foo", - MD5Sum = base64:encode_to_string(crypto:md5(Body)), + MD5Sum = base64:encode_to_string(crypto:hash(md5, Body)), Headers = [{"Content-MD5", MD5Sum}], PutRequest = {url("new"), Headers, ContentType, Body}, {ok, Result} = httpc:request(put, PutRequest, [], []), @@ -1237,7 +1237,7 @@ stream_content_md5() -> put_setting(allow_missing_post, true), ContentType = "text/plain", Content = "foo", - ValidMD5Sum = base64:encode_to_string(crypto:md5(Content)), + ValidMD5Sum = base64:encode_to_string(crypto:hash(md5, Content)), ibrowse:start(), Url = url("post"), Headers = [{"Content-Type", ContentType},