mod_http_file_share: Move number coercion into util.dataforms
authorKim Alvefur <zash@zash.se>
Mon, 25 Oct 2021 21:45:06 +0200
changeset 11877 2b85e4e7d389
parent 11876 ffff0d8a9c68
child 11878 84f4c6957d62
mod_http_file_share: Move number coercion into util.dataforms
plugins/mod_http_file_share.lua
--- a/plugins/mod_http_file_share.lua	Mon Oct 25 21:43:23 2021 +0200
+++ b/plugins/mod_http_file_share.lua	Mon Oct 25 21:45:06 2021 +0200
@@ -47,8 +47,8 @@
 
 module:add_extension(dataform {
 	{ name = "FORM_TYPE", type = "hidden", value = namespace },
-	{ name = "max-file-size", type = "text-single" },
-}:form({ ["max-file-size"] = tostring(file_size_limit) }, "result"));
+	{ name = "max-file-size", type = "text-single", datatype = "xs:integer" },
+}:form({ ["max-file-size"] = file_size_limit }, "result"));
 
 local upload_errors = errors.init(module.name, namespace, {
 	access = { type = "auth"; condition = "forbidden" };