Fixed: s2smanager: Apply nameprep on hostnames passed in stream tag (part of issue #57)
--- a/core/s2smanager.lua Mon Mar 30 03:03:06 2009 +0500
+++ b/core/s2smanager.lua Mon Mar 30 03:06:01 2009 +0500
@@ -24,6 +24,7 @@
local modulemanager = require "core.modulemanager";
local st = require "stanza";
local stanza = st.stanza;
+local nameprep = require "util.encodings".stringprep.nameprep;
local uuid_gen = require "util.uuid".generate;
@@ -211,8 +212,8 @@
if session.direction == "incoming" then
-- Send a reply stream header
- session.to_host = attr.to;
- session.from_host = attr.from;
+ session.to_host = nameprep(attr.to);
+ session.from_host = nameprep(attr.from);
session.streamid = uuid_gen();
(session.log or log)("debug", "incoming s2s received <stream:stream>");