aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-09 22:32:01 +0200
committerKim Alvefur <zash@zash.se>2019-09-09 22:32:01 +0200
commitef60c12bef4c6c461e05355f2fe036aac140ab33 (patch)
treedc9e837b3bbb6b6bfb11c0c69e78987deeb06622 /core
parent988243a601855d2f91ea6f9d1057b25a14c62275 (diff)
downloadprosody-ef60c12bef4c6c461e05355f2fe036aac140ab33.tar.gz
prosody-ef60c12bef4c6c461e05355f2fe036aac140ab33.zip
core.stanza_router: Do strict jidprep on c2s
Be conservative in what you let your clients send, be liberal in what you let in via s2s. Being strict on s2s leads to interop problems and poor experiences, ie users being ejected from MUCs if something invalid enters. By starting with tightening up input into the network, we may be able to gradually approach a point where no invalid JIDs are allowed.
Diffstat (limited to 'core')
-rw-r--r--core/stanza_router.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index a74f3b6f..9d3ab113 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -83,7 +83,7 @@ function core_process_stanza(origin, stanza)
if full_sessions[to] or bare_sessions[to] or hosts[to] then
node, host = jid_split(to); -- TODO only the host is needed, optimize
else
- node, host, resource = jid_prepped_split(to);
+ node, host, resource = jid_prepped_split(to, origin.type == "c2s");
if not host then
log("warn", "Received stanza with invalid destination JID: %s", to);
if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then