diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-02 19:38:12 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-02 19:38:12 +0100 |
commit | 0be184cb1d2157da3dce8ab3adcb5b9b8a0e94cc (patch) | |
tree | 959d4a49be75f90dbcb5555db7054c7cdcc01905 /net/resolvers/basic.lua | |
parent | 2a10ceae09f3bc7e0978e3a3d57943dccc232e9f (diff) | |
parent | ae75d537f6a9f175f2ded30e0866aa2c092872f0 (diff) | |
download | prosody-0be184cb1d2157da3dce8ab3adcb5b9b8a0e94cc.tar.gz prosody-0be184cb1d2157da3dce8ab3adcb5b9b8a0e94cc.zip |
Merge 0.11->trunk
Diffstat (limited to 'net/resolvers/basic.lua')
-rw-r--r-- | net/resolvers/basic.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/resolvers/basic.lua b/net/resolvers/basic.lua index 56f9c77d..7f25a894 100644 --- a/net/resolvers/basic.lua +++ b/net/resolvers/basic.lua @@ -1,5 +1,6 @@ local adns = require "net.adns"; local inet_pton = require "util.net".pton; +local idna_to_ascii = require "util.encodings".idna.to_ascii; local unpack = table.unpack or unpack; -- luacheck: ignore 113 local methods = {}; @@ -18,6 +19,11 @@ function methods:next(cb) return; end + if not self.hostname then + -- FIXME report IDNA error + cb(nil); + end + local targets = {}; local n = 2; local function ready() @@ -60,7 +66,7 @@ end local function new(hostname, port, conn_type, extra) return setmetatable({ - hostname = hostname; + hostname = idna_to_ascii(hostname); port = port; conn_type = conn_type or "tcp"; extra = extra; |