# HG changeset patch # User Kim Alvefur # Date 1611703722 -3600 # Node ID 79e1f407b6f5337fc13f96bd91d3e065b3977e44 # Parent ae0461b37fbebf289c80e10d8dea525207b3a5d2 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 diff -r ae0461b37fbe -r 79e1f407b6f5 plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Wed Jan 27 00:09:49 2021 +0100 +++ b/plugins/mod_http_file_share.lua Wed Jan 27 00:28:42 2021 +0100 @@ -43,11 +43,12 @@ }: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