From 69f252bebf22299c0da92804238fd6fbacc0dcca Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 13 Dec 2017 15:34:53 +0100 Subject: mod_bosh: Limit stream to current host (fixes #371) --- plugins/mod_bosh.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index d75a9e45..2cb63bdf 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -6,7 +6,6 @@ -- COPYING file in the source package for more information. -- -local hosts = _G.hosts; local new_xmpp_stream = require "util.xmppstream".new; local sm = require "core.sessionmanager"; local sm_destroy_session = sm.destroy_session; @@ -283,7 +282,7 @@ function stream_callbacks.streamopened(context, attr) ["xmlns:stream"] = xmlns_streams, condition = "improper-addressing" }); response:send(tostring(close_reply)); return; - elseif not hosts[to_host] then + elseif to_host ~= module.host then -- Unknown host log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", -- cgit v1.2.3