Software /
code /
prosody
Diff
core/sessionmanager.lua @ 930:fed53329818d
Fixed: sessionmanager: Apply nameprep on hostname passed in stream tag (part of issue #57)
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 30 Mar 2009 03:03:06 +0500 |
parent | 896:2c0b9e3c11c3 |
child | 950:a00b4269de70 |
line wrap: on
line diff
--- a/core/sessionmanager.lua Mon Mar 30 02:56:34 2009 +0500 +++ b/core/sessionmanager.lua Mon Mar 30 03:03:06 2009 +0500 @@ -23,6 +23,7 @@ local uuid_generate = require "util.uuid".generate; local rm_load_roster = require "core.rostermanager".load_roster; local config_get = require "core.configmanager".get; +local nameprep = require "util.encodings".stringprep.nameprep; local fire_event = require "core.eventmanager".fire_event; @@ -156,6 +157,7 @@ function streamopened(session, attr) local send = session.send; session.host = attr.to or error("Client failed to specify destination hostname"); + session.host = nameprep(session.host); session.version = tonumber(attr.version) or 0; session.streamid = m_random(1000000, 99999999); (session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host);