Skip to content

Instantly share code, notes, and snippets.

@lorenz
Created September 5, 2017 18:52
Show Gist options
  • Save lorenz/b8027a13665d52f8bf9bfa69b311c977 to your computer and use it in GitHub Desktop.
Save lorenz/b8027a13665d52f8bf9bfa69b311c977 to your computer and use it in GitHub Desktop.
Prosody HTTP upload fix
diff --git a/mod_http_upload/mod_http_upload.lua b/mod_http_upload/mod_http_upload.lua
--- a/mod_http_upload/mod_http_upload.lua
+++ b/mod_http_upload/mod_http_upload.lua
@@ -171,8 +171,14 @@
slot_url.path.is_directory = false;
slot_url.path = url.build_path(slot_url.path);
slot_url = url.build(slot_url);
- reply:tag("get"):text(slot_url):up();
- reply:tag("put"):text(slot_url):up();
+ if xmlns == legacy_namespace then
+ reply:tag("get"):text(slot_url):up();
+ reply:tag("put"):text(slot_url):up();
+ end
+ if xmlns == namespace then
+ reply:tag("get", { url = slot_url }):up();
+ reply:tag("put", { url = slot_url }):up();
+ end
origin.send(reply);
origin.log("debug", "Given upload slot %q", slot);
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment