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 | 690775a9b4cc8b36c5f46211c713d4638cc99c1c (patch) | |
tree | 959d4a49be75f90dbcb5555db7054c7cdcc01905 /net/resolvers/basic.lua | |
parent | 1a78e0a7ac93b3d0b4251a865eb994bcd3e5eaba (diff) | |
parent | 9c2a74d09c9c45d165a4bcf51f4debfac8877e36 (diff) | |
download | prosody-690775a9b4cc8b36c5f46211c713d4638cc99c1c.tar.gz prosody-690775a9b4cc8b36c5f46211c713d4638cc99c1c.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; |