comparison mod_http_upload/mod_http_upload.lua @ 2445:e822900c87d4

mod_http_upload: Correctly attach extended error information
author Kim Alvefur <zash@zash.se>
date Mon, 16 Jan 2017 01:45:05 +0100
parents 3e9f9cef9c0e
children 290fef768a81
comparison
equal deleted inserted replaced
2444:3e9f9cef9c0e 2445:e822900c87d4
75 module:log("debug", "Missing file size"); 75 module:log("debug", "Missing file size");
76 origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing or invalid file size")); 76 origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing or invalid file size"));
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 :tag("file-too-large", {xmlns=xmlns_http_upload})
82 :tag("max-file-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();