# HG changeset patch # User Kim Alvefur # Date 1513175693 -3600 # Node ID 81fff93d3bc696feba9e40d07976db23e4d42d24 # Parent 30671b378ab54e15568fb099d6c601ff6074e913 mod_bosh: Limit stream to current host (fixes #371) diff -r 30671b378ab5 -r 81fff93d3bc6 plugins/mod_bosh.lua --- 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",