diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-03-14 02:59:16 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-03-14 02:59:16 +0000 |
commit | c42dd4c96236f0b83654d83613d7d3cf5dffef84 (patch) | |
tree | 38d4e710d314b8e99f964f8b08d348d41d5a6475 /core | |
parent | 8b94f4df2504444121a345c430538b0a409e059d (diff) | |
download | prosody-c42dd4c96236f0b83654d83613d7d3cf5dffef84.tar.gz prosody-c42dd4c96236f0b83654d83613d7d3cf5dffef84.zip |
sessionmanager: Return stream error when incoming stream header is missing 'to' attribute
Diffstat (limited to 'core')
-rw-r--r-- | core/sessionmanager.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 5c40f756..264c296b 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -181,7 +181,12 @@ end function streamopened(session, attr) local send = session.send; - session.host = attr.to or error("Client failed to specify destination hostname"); + session.host = attr.to; + if not session.host then + session:close{ condition = "improper-addressing", + text = "A 'to' attribute is required on stream headers" }; + return; + end session.host = nameprep(session.host); session.version = tonumber(attr.version) or 0; session.streamid = uuid_generate(); |