aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-27 00:28:42 +0100
committerKim Alvefur <zash@zash.se>2021-01-27 00:28:42 +0100
commit78b0c08aacf2bfc4525782ca41189b4acef1a875 (patch)
tree4886a78968747c54fb7390ead26e93cb392b5a3d /plugins
parent987976f20f4428af0981d69c3afda0047f4bea5e (diff)
downloadprosody-78b0c08aacf2bfc4525782ca41189b4acef1a875.tar.gz
prosody-78b0c08aacf2bfc4525782ca41189b4acef1a875.zip
mod_http_file_share: Expand registry to fix extra tag
Error registry compact format doesn't support extra.tag so needs to be the more verbose format
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http_file_share.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index ef427b94..7256b063 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -43,11 +43,12 @@ module:add_extension(dataform {
}:form({ ["max-file-size"] = tostring(file_size_limit) }, "result"));
local upload_errors = errors.init(module.name, namespace, {
- access = { "auth"; "forbidden" };
- filename = { "modify"; "bad-request", "Invalid filename" };
- filetype = { "modify"; "not-acceptable", "File type not allowed" };
- filesize = { "modify"; "not-acceptable"; "File too large";
- st.stanza("file-too-large", {xmlns = namespace}):tag("max-size"):text(tostring(file_size_limit)); };
+ access = { type = "auth"; condition = "forbidden" };
+ filename = { type = "modify"; condition = "bad-request"; text = "Invalid filename" };
+ filetype = { type = "modify"; condition = "not-acceptable"; text = "File type not allowed" };
+ filesize = { type = "modify"; condition = "not-acceptable"; text = "File too large";
+ extra = {tag = st.stanza("file-too-large", {xmlns = namespace}):tag("max-size"):text(tostring(file_size_limit)) };
+ };
});
function may_upload(uploader, filename, filesize, filetype) -- > boolean, error