Software /
code /
prosody
Diff
util/jid.lua @ 5946:04f2138dfa87
Merge 0.10->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 16 Dec 2013 02:04:43 +0000 |
parent | 5945:51ead0aa3a02 |
child | 6338:736c388748fd |
line wrap: on
line diff
--- a/util/jid.lua Fri Dec 13 12:53:14 2013 +0000 +++ b/util/jid.lua Mon Dec 16 02:04:43 2013 +0000 @@ -8,7 +8,7 @@ -local match = string.match; +local match, sub = string.match, string.sub; local nodeprep = require "util.encodings".stringprep.nodeprep; local nameprep = require "util.encodings".stringprep.nameprep; local resourceprep = require "util.encodings".stringprep.resourceprep; @@ -47,6 +47,9 @@ local function _prepped_split(jid) local node, host, resource = _split(jid); if host then + if sub(host, -1, -1) == "." then -- Strip empty root label + host = sub(host, 1, -2); + end host = nameprep(host); if not host then return; end if node then