aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http_file_share.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index 8f230ef4..4c9dc9e9 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -34,10 +34,14 @@ if not external_base_url then
module:depends("http");
end
+local upload_errors = errors.init(module.name, namespace, {
+ access = { "auth"; "forbidden" };
+});
+
function may_upload(uploader, filename, filesize, filetype) -- > boolean, error
local uploader_host = jid.host(uploader);
if not ((access:empty() and prosody.hosts[uploader_host]) or access:contains(uploader) or access:contains(uploader_host)) then
- return false;
+ return false, upload_errors.new("access");
end
return true;