# HG changeset patch # User Kim Alvefur # Date 1572719066 -3600 # Node ID 94c9c574cd8ac3d14ee2ca5e144aab7f4b76dd2e # Parent 3852fc91b2fc2e2e9ba0a215eaff4569dbf84a38 net.resolvers: Apply IDNA conversion to ascii for DNS lookups (fixes #1426) diff -r 3852fc91b2fc -r 94c9c574cd8a net/resolvers/basic.lua --- a/net/resolvers/basic.lua Sun Oct 20 20:52:14 2019 +0200 +++ b/net/resolvers/basic.lua Sat Nov 02 19:24:26 2019 +0100 @@ -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 @@ 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 -r 3852fc91b2fc -r 94c9c574cd8a net/resolvers/service.lua --- a/net/resolvers/service.lua Sun Oct 20 20:52:14 2019 +0200 +++ b/net/resolvers/service.lua Sat Nov 02 19:24:26 2019 +0100 @@ -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 @@ 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;