mod_http_upload: Ensure integer formatting of size limit
Prevents problems when running under Lua 5.3+ where floating point
numbers always have a decimal dot when tostring()-ed.
--- a/mod_http_upload/mod_http_upload.lua Wed Aug 21 00:38:20 2019 +0200
+++ b/mod_http_upload/mod_http_upload.lua Thu Aug 22 23:57:57 2019 +0200
@@ -93,12 +93,12 @@
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"));
+}:form({ ["max-file-size"] = ("%d"):format(file_size_limit) }, "result"));
module:add_extension(dataform {
{ name = "FORM_TYPE", type = "hidden", value = legacy_namespace },
{ name = "max-file-size", type = "text-single" },
-}:form({ ["max-file-size"] = tostring(file_size_limit) }, "result"));
+}:form({ ["max-file-size"] = ("%d"):format(file_size_limit) }, "result"));
-- state
local pending_slots = module:shared("upload_slots");