Diff

mod_http_upload/mod_http_upload.lua @ 3649:d252c8573f33

mod_http_upload: Also format max file size as integer in error (thanks lovetox)
author Kim Alvefur <zash@zash.se>
date Fri, 23 Aug 2019 00:19:46 +0200
parent 3648:aa12b95a6d36
child 3657:3fb0add97cdb
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua	Thu Aug 22 23:57:57 2019 +0200
+++ b/mod_http_upload/mod_http_upload.lua	Fri Aug 23 00:19:46 2019 +0200
@@ -179,7 +179,7 @@
 		module:log("debug", "File too large (%d > %d)", filesize, file_size_limit);
 		return nil, st.error_reply(stanza, "modify", "not-acceptable", "File too large")
 			:tag("file-too-large", {xmlns=xmlns})
-				:tag("max-file-size"):text(tostring(file_size_limit));
+				:tag("max-file-size"):text(("%d"):format(file_size_limit));
 	elseif not check_quota(username, host, filesize) then
 		module:log("debug", "Upload of %dB by %s would exceed quota", filesize, origin.full_jid);
 		return nil, st.error_reply(stanza, "wait", "resource-constraint", "Quota reached");