From: Badlop Date: Wed, 16 Nov 2016 12:11:23 +0000 (+0100) Subject: Handle correctly p1_http:request result X-Git-Tag: 16.12-beta1~49^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1723c6e2d83f0d3d65f151a10610f58a54859cf;p=ejabberd Handle correctly p1_http:request result --- diff --git a/src/ext_mod.erl b/src/ext_mod.erl index 2f71343a2..a2109e569 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -272,9 +272,9 @@ geturl(Url, Hdrs, UsrOpts) -> _ -> [] end, case p1_http:request(get, Url, Hdrs, [], Host++User++UsrOpts++[{version, "HTTP/1.0"}]) of - {ok, {{_, 200, _}, Headers, Response}} -> + {ok, 200, Headers, Response} -> {ok, Headers, Response}; - {ok, {{_, Code, _}, _Headers, Response}} -> + {ok, Code, _Headers, Response} -> {error, {Code, Response}}; {error, Reason} -> {error, Reason}