From 16d3261f03b2d2ed9cd0b467fada388a207a1f67 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sat, 27 May 2017 20:31:32 +0200 Subject: prosody-module: treat empty file url also as invalid; treat status code 404 (not available) in case of deleting a file the same as 204 (deleted by this operation) --- prosody-module/mod_http_upload_external/mod_http_upload_external.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua index 50f1f78..e2e0107 100644 --- a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua +++ b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua @@ -121,7 +121,7 @@ end local function deletefile(origin, orig_from, stanza, request) -- validate local fileurl = request:get_child_text("fileurl"); - if not fileurl then + if not fileurl or fileurl == '' then origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid fileurl")); return true; end @@ -169,7 +169,7 @@ local function deletefile(origin, orig_from, stanza, request) return true; end end - elseif statuscode == 204 then + elseif statuscode == 204 or statuscode == 404 then local reply = st.reply(stanza); reply:tag("deleted", { xmlns = xmlns_http_upload }); origin.send(reply); -- cgit v1.2.3