25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Handle correctly p1_http:request result

This commit is contained in:
Badlop 2016-11-16 13:11:23 +01:00
parent 2929f5b5bc
commit b1723c6e2d

View File

@ -272,9 +272,9 @@ geturl(Url, Hdrs, UsrOpts) ->
_ -> [] _ -> []
end, end,
case p1_http:request(get, Url, Hdrs, [], Host++User++UsrOpts++[{version, "HTTP/1.0"}]) of 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, Headers, Response};
{ok, {{_, Code, _}, _Headers, Response}} -> {ok, Code, _Headers, Response} ->
{error, {Code, Response}}; {error, {Code, Response}};
{error, Reason} -> {error, Reason} ->
{error, Reason} {error, Reason}