aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-03-30 03:06:01 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-03-30 03:06:01 +0500
commit985a40227efb833c3ff085dc0001f93ce2b9e751 (patch)
tree6feeab41bb475e684177f20e5782635287156e1d
parent3f5c2d00542fdee9a7c6d9abedd3d32209878625 (diff)
downloadprosody-985a40227efb833c3ff085dc0001f93ce2b9e751.tar.gz
prosody-985a40227efb833c3ff085dc0001f93ce2b9e751.zip
Fixed: s2smanager: Apply nameprep on hostnames passed in stream tag (part of issue #57)
-rw-r--r--core/s2smanager.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 19b7f047..4e12eb8a 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -24,6 +24,7 @@ local wrapclient = require "net.server".wrapclient;
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 @@ function streamopened(session, attr)
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>");