Diff

net/resolvers/basic.lua @ 10385:62a7042e0771 0.11

net.resolvers: Abort on hostnames not passing IDNA validation Prevents error on trying to use nil. Needs better error reporting in the future.
author Kim Alvefur <zash@zash.se>
date Sat, 02 Nov 2019 19:36:19 +0100
parent 10384:94c9c574cd8a
child 10386:cf93a951da37
child 10400:4c2d789a106b
line wrap: on
line diff
--- a/net/resolvers/basic.lua	Sat Nov 02 19:24:26 2019 +0100
+++ b/net/resolvers/basic.lua	Sat Nov 02 19:36:19 2019 +0100
@@ -18,6 +18,11 @@
 		return;
 	end
 
+	if not self.hostname then
+		-- FIXME report IDNA error
+		cb(nil);
+	end
+
 	local targets = {};
 	local n = 2;
 	local function ready()