comparison mod_http_upload/mod_http_upload.lua @ 1850:e3a0ebe671cc

mod_http_upload: Include failure reason in error response
author Kim Alvefur <zash@zash.se>
date Mon, 14 Sep 2015 12:45:00 +0200
parents 5244c9b0b297
children 03c5639882a7
comparison
equal deleted inserted replaced
1849:5244c9b0b297 1850:e3a0ebe671cc
41 return true; 41 return true;
42 end 42 end
43 -- validate 43 -- validate
44 local filename = request:get_child_text("filename"); 44 local filename = request:get_child_text("filename");
45 if not filename or filename:find("/") then 45 if not filename or filename:find("/") then
46 origin.send(st.error_reply(stanza, "modify", "bad-request")); 46 origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid filename"));
47 return true; 47 return true;
48 end 48 end
49 local reply = st.reply(stanza); 49 local reply = st.reply(stanza);
50 reply:tag("slot", { xmlns = xmlns_http_upload }); 50 reply:tag("slot", { xmlns = xmlns_http_upload });
51 local random = uuid(); 51 local random = uuid();