Changeset

8524:81fff93d3bc6

mod_bosh: Limit stream to current host (fixes #371)
author Kim Alvefur <zash@zash.se>
date Wed, 13 Dec 2017 15:34:53 +0100
parents 8523:30671b378ab5
children 8525:7be8f649d97d
files plugins/mod_bosh.lua
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_bosh.lua	Wed Dec 13 15:24:02 2017 +0100
+++ b/plugins/mod_bosh.lua	Wed Dec 13 15:34:53 2017 +0100
@@ -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 @@
 				["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",