aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-01 18:41:30 +0200
committerKim Alvefur <zash@zash.se>2020-08-01 18:41:30 +0200
commit30cf0db09c12d17be72ad55fe8820e9fd7cf7e68 (patch)
tree9aae09199af4f2ade66a55c9904b9f9510c13e95
parenteefe8a76880872993d0f65f600830b91caabbe23 (diff)
downloadprosody-30cf0db09c12d17be72ad55fe8820e9fd7cf7e68.tar.gz
prosody-30cf0db09c12d17be72ad55fe8820e9fd7cf7e68.zip
mod_http: Add way to signal that a module supports streaming uploads
Fixes #726 API: module:provides("http", { streaming_uploads = true; route = { PUT = function (event) event.request.body_sink = io.tmpfile(); return true; end } })
-rw-r--r--plugins/mod_http.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index 54c6089b..1248a06c 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -138,6 +138,8 @@ function module.add_host(module)
return "";
end
+ local streaming = event.item.streaming_uploads;
+
for key, handler in pairs(event.item.route or {}) do
local event_name = get_http_event(host, app_path, key);
if event_name then
@@ -160,7 +162,7 @@ function module.add_host(module)
elseif event_name:sub(-1, -1) == "/" then
module:hook_object_event(server, event_name:sub(1, -2), redir_handler, -1);
end
- do
+ if not streaming then
-- COMPAT Modules not compatible with streaming uploads behave as before.
local _handler = handler;
function handler(event) -- luacheck: ignore 432/event