Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 2443:7f9ff36dc8d5
mod_http_upload: Update for size limit error reporting change in XEP-0363 v0.2 (fixes #813)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 16 Jan 2017 01:40:45 +0100 |
parents | 827f01cbf6ba |
children | 3e9f9cef9c0e |
comparison
equal
deleted
inserted
replaced
2442:b2a198665946 | 2443:7f9ff36dc8d5 |
---|---|
77 return true; | 77 return true; |
78 elseif filesize > file_size_limit then | 78 elseif filesize > file_size_limit then |
79 module:log("debug", "File too large (%d > %d)", filesize, file_size_limit); | 79 module:log("debug", "File too large (%d > %d)", filesize, file_size_limit); |
80 origin.send(st.error_reply(stanza, "modify", "not-acceptable", "File too large", | 80 origin.send(st.error_reply(stanza, "modify", "not-acceptable", "File too large", |
81 st.stanza("file-too-large", {xmlns=xmlns_http_upload}) | 81 st.stanza("file-too-large", {xmlns=xmlns_http_upload}) |
82 :tag("max-size"):text(tostring(file_size_limit)))); | 82 :tag("max-file-size"):text(tostring(file_size_limit)))); |
83 return true; | 83 return true; |
84 end | 84 end |
85 local reply = st.reply(stanza); | 85 local reply = st.reply(stanza); |
86 reply:tag("slot", { xmlns = xmlns_http_upload }); | 86 reply:tag("slot", { xmlns = xmlns_http_upload }); |
87 local random = uuid(); | 87 local random = uuid(); |