Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(visitors): Do not send error replies for errors.

damencho842d0a9aefe8
diff --git a/resources/prosody-plugins/mod_s2s_whitelist.lua b/resources/prosody-plugins/mod_s2s_whitelist.lua
index c2f28040a6..0ce23857f8 100644
--- a/resources/prosody-plugins/mod_s2s_whitelist.lua
+++ b/resources/prosody-plugins/mod_s2s_whitelist.lua
@@ -1,10 +1,16 @@
--- Using version https://hg.prosody.im/prosody-modules/file/c1a8ce147885/mod_s2s_whitelist/mod_s2s_whitelist.lua
+-- Using as a base version https://hg.prosody.im/prosody-modules/file/c1a8ce147885/mod_s2s_whitelist/mod_s2s_whitelist.lua
local st = require "util.stanza";
local whitelist = module:get_option_inherited_set("s2s_whitelist", {});
module:hook("route/remote", function (event)
if not whitelist:contains(event.to_host) then
+ -- make sure we do not send error replies for errors
+ if event.stanza.attr.type == 'error' then
+ module:log('info', 'Not whitelisted destination domain for an error: %s', event.stanza);
+ return true;
+ end
+
module:send(st.error_reply(event.stanza, "cancel", "not-allowed", "Communication with this domain is restricted"));
return true;
end