--- a/plugins/mod_http_file_share.lua Tue Jan 26 14:39:11 2021 +0100
+++ b/plugins/mod_http_file_share.lua Tue Jan 26 14:51:55 2021 +0100
@@ -34,10 +34,14 @@
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;