aboutsummaryrefslogtreecommitdiffstats
path: root/prosody-module/mod_http_upload_external
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-02-05 14:13:41 +0100
committersteckbrief <steckbrief@chefmail.de>2016-02-05 14:13:41 +0100
commit14cc1291edc0002645d7a24d964cda155d0ccd81 (patch)
tree521c9bfde2489cca7400a8550d6ecc5e70163cc9 /prosody-module/mod_http_upload_external
parent7f77bd308784a55193a3d18bacf079df5494511c (diff)
parent546781317494c225b9446bacd368f618917fdf52 (diff)
Merge branch 'master' of https://github.com/steckbrief/httpupload
Diffstat (limited to 'prosody-module/mod_http_upload_external')
-rw-r--r--prosody-module/mod_http_upload_external/mod_http_upload_external.lua10
1 files changed, 8 insertions, 2 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 af6d48a..768a956 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
@@ -10,8 +10,8 @@
--
-- configuration
-local external_url = "https://snippets.thedevstack.de/httpupload/index.php";
-local xmpp_server_key = "1323978hjkgh12";
+local external_url = module:get_option("http_upload_external_url");
+local xmpp_server_key = module:get_option("http_upload_external_server_key");
-- imports
local st = require"util.stanza";
@@ -36,6 +36,12 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
origin.send(st.error_reply(stanza, "cancel", "not-authorized"));
return true;
end
+ -- check configuration
+ if not external_url or not xmpp_server_key then
+ module:log("debug", "missing configuration options: http_upload_external_url and/or http_upload_external_server_key");
+ origin.send(st.error_reply(stanza, "cancel", "internal-server-error"));
+ return true;
+ end
-- validate
local filename = request:get_child_text("filename");
if not filename then