aboutsummaryrefslogtreecommitdiff
path: root/src/rest.erl
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2019-05-07 14:09:22 +0200
committerMickael Remond <mremond@process-one.net>2019-05-07 14:09:22 +0200
commit945c58d3dbaba5fcaface2ff8e08964df80b0b76 (patch)
treedf579bc86f659b8b3d7663b7ed4611ed3c736c13 /src/rest.erl
parentPut back the presence and s2s tests in the no_db section. (diff)
parentRaise api hook right before performing the call (diff)
Merge branch 'master' of github.com:processone/ejabberd
Diffstat (limited to 'src/rest.erl')
-rw-r--r--src/rest.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rest.erl b/src/rest.erl
index 05d1b9d4a..9c1b28068 100644
--- a/src/rest.erl
+++ b/src/rest.erl
@@ -100,6 +100,7 @@ request(Server, Method, Path, Params, Mime, Data) ->
{URI, Hdrs}
end,
Begin = os:timestamp(),
+ ejabberd_hooks:run(backend_api_call, Server, [Server, Method, Path]),
Result = try httpc:request(Method, Req, HttpOpts, [{body_format, binary}]) of
{ok, {{_, Code, _}, RetHdrs, Body}} ->
try decode_json(Body) of
@@ -118,7 +119,6 @@ request(Server, Method, Path, Params, Mime, Data) ->
exit:Reason ->
{error, {http_error, {error, Reason}}}
end,
- ejabberd_hooks:run(backend_api_call, Server, [Server, Method, Path]),
case Result of
{error, {http_error, {error, timeout}}} ->
ejabberd_hooks:run(backend_api_timeout, Server,