aboutsummaryrefslogtreecommitdiffstats
path: root/prosody-module/mod_http_upload_external
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-01-06 15:16:43 +0100
committerlookshe <github@lookshe.org>2016-01-06 15:16:43 +0100
commitb72fb066c91a366dc16921b1ab7462831f7a8e2e (patch)
tree032db0b696e40b2bc5a044fc781e534469a5ec70 /prosody-module/mod_http_upload_external
parentc78c0821273c6bd5ea717ca01ad0fe5fd0dcfad5 (diff)
check for 403 (wrong xmpp_server_key)
Diffstat (limited to 'prosody-module/mod_http_upload_external')
-rw-r--r--prosody-module/mod_http_upload_external/mod_http_upload_external.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua
index 12d25b8..af6d48a 100644
--- a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua
+++ b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua
@@ -66,7 +66,7 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
-- check the response
if statuscode == 500 then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable", respbody));
- elseif statuscode == 406 or statuscode == 400 then
+ elseif statuscode == 406 or statuscode == 400 or statuscode == 403 then
local errobj, pos, err = json.decode(respbody);
if err then
origin.send(st.error_reply(stanza, "wait", "internal-server-error", err));
@@ -95,6 +95,8 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
origin.send(st.error_reply(stanza, "cancel", "undefined-condition", "unknown err_code"));
return true;
end
+ elseif statuscode == 403 and errobj["msg"] ~= nil then
+ origin.send(st.error_reply(stanza, "cancel", "internal-server-error", errobj.msg));
else
origin.send(st.error_reply(stanza, "cancel", "undefined-condition", "msg or err_code not found"));
return true;