Last active
August 29, 2015 13:57
-
-
Save zeen/9491993 to your computer and use it in GitHub Desktop.
Relax mod_component host check to allow node@host components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r c0ee152400ff plugins/mod_component.lua | |
--- a/plugins/mod_component.lua Sun Mar 09 23:48:32 2014 +0100 | |
+++ b/plugins/mod_component.lua Tue Mar 11 14:30:49 2014 -0400 | |
@@ -197,8 +197,8 @@ | |
local from = stanza.attr.from; | |
if from then | |
if session.component_validate_from then | |
- local _, domain = jid_split(stanza.attr.from); | |
- if domain ~= session.host then | |
+ local node, domain = jid_split(stanza.attr.from); | |
+ if domain ~= session.host and (node and node.."@"..domain or domain) ~= session.host then | |
-- Return error | |
session.log("warn", "Component sent stanza with missing or invalid 'from' address"); | |
session:close{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment