Diff

core/s2smanager.lua @ 931:4514ed5ee943

Fixed: s2smanager: Apply nameprep on hostnames passed in stream tag (part of issue #57)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 30 Mar 2009 03:06:01 +0500
parent 896:2c0b9e3c11c3
child 938:663f75dd7b42
line wrap: on
line diff
--- 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>");