From 68296b6a8e6faa6ff076f634960d21adf5f17ada Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 22 Feb 2025 21:45:34 +0100 Subject: [PATCH 1/2] mod_bosh,mod_websocket: Don't load mod_http_altconnect in global context It blocked loading on VirtualHosts since it was already loaded globally Thanks eTaurus --- plugins/mod_bosh.lua | 4 +++- plugins/mod_websocket.lua | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index fc2c92ae0..2d1b1922a 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -558,7 +558,9 @@ function module.add_host(module) }; }); - module:depends("http_altconnect", true); + if module.host ~= "*" then + module:depends("http_altconnect", true); + end end if require"prosody.core.modulemanager".get_modules_for_host("*"):contains(module.name) then diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua index dfc1a2159..206ad6786 100644 --- a/plugins/mod_websocket.lua +++ b/plugins/mod_websocket.lua @@ -367,7 +367,9 @@ function module.add_host(module) }; }); - module:depends("http_altconnect", true); + if module.host ~= "*" then + module:depends("http_altconnect", true); + end module:hook("c2s-read-timeout", keepalive, -0.9); end From e52cc0126df37947718c18b590b682943ec6da16 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 22 Feb 2025 21:48:07 +0100 Subject: [PATCH 2/2] mod_component: Don't return error reply for errors, fixes #1897 --- plugins/mod_component.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index 86ceb9800..51c73235c 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -239,7 +239,9 @@ function stream_callbacks.handlestanza(session, stanza) end if not stanza.attr.to then session.log("warn", "Rejecting stanza with no 'to' address"); - session.send(st.error_reply(stanza, "modify", "bad-request", "Components MUST specify a 'to' address on stanzas")); + if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then + session.send(st.error_reply(stanza, "modify", "bad-request", "Components MUST specify a 'to' address on stanzas")); + end return; end end