aboutsummaryrefslogtreecommitdiffstats
path: root/prosody-module/mod_http_upload_external
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-05-27 20:31:32 +0200
committersteckbrief <steckbrief@chefmail.de>2017-05-27 20:34:06 +0200
commit16d3261f03b2d2ed9cd0b467fada388a207a1f67 (patch)
tree87f1a92ea82e6252f2f66c738cdda5add009c275 /prosody-module/mod_http_upload_external
parent0885d997f9f4632a8ebb9955ca0c9d9d537f1e08 (diff)
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)
Diffstat (limited to 'prosody-module/mod_http_upload_external')
-rw-r--r--prosody-module/mod_http_upload_external/mod_http_upload_external.lua4
1 files 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);