aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-02 19:24:26 +0100
committerKim Alvefur <zash@zash.se>2019-11-02 19:24:26 +0100
commitce96d43cab1c757fd68ee6cfc19ad71c90c9e298 (patch)
treeb491ea7660716e705aaf6443844e19e2e035d179 /net
parent2a7b5fee5b95d8b1f4ce0f597dae658411ffb303 (diff)
downloadprosody-ce96d43cab1c757fd68ee6cfc19ad71c90c9e298.tar.gz
prosody-ce96d43cab1c757fd68ee6cfc19ad71c90c9e298.zip
net.resolvers: Apply IDNA conversion to ascii for DNS lookups (fixes #1426)
Diffstat (limited to 'net')
-rw-r--r--net/resolvers/basic.lua3
-rw-r--r--net/resolvers/service.lua3
2 files changed, 4 insertions, 2 deletions
diff --git a/net/resolvers/basic.lua b/net/resolvers/basic.lua
index 9a3c9952..d8031a6b 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 methods = {};
local resolver_mt = { __index = methods };
@@ -59,7 +60,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;
diff --git a/net/resolvers/service.lua b/net/resolvers/service.lua
index b5a2d821..a76adb73 100644
--- a/net/resolvers/service.lua
+++ b/net/resolvers/service.lua
@@ -1,5 +1,6 @@
local adns = require "net.adns";
local basic = require "net.resolvers.basic";
+local idna_to_ascii = require "util.encodings".idna.to_ascii;
local methods = {};
local resolver_mt = { __index = methods };
@@ -58,7 +59,7 @@ end
local function new(hostname, service, conn_type, extra)
return setmetatable({
- hostname = hostname;
+ hostname = idna_to_ascii(hostname);
service = service;
conn_type = conn_type or "tcp";
extra = extra;