util.prosodyctl.check: Normalize potential to form without trailing '.'
authorKim Alvefur <zash@zash.se>
Sun, 04 Jul 2021 01:33:53 +0200
changeset 11658 52c7a0e74bb2
parent 11657 51141309ffc4
child 11659 bbf50525faa5
util.prosodyctl.check: Normalize potential to form without trailing '.' In some cases you might end up with both 'xmpp.example.com' and 'xmpp.example.com.', which are the same thing so no point in doing the same checks twice.
util/prosodyctl/check.lua
--- a/util/prosodyctl/check.lua	Sun Jul 04 01:32:04 2021 +0200
+++ b/util/prosodyctl/check.lua	Sun Jul 04 01:33:53 2021 +0200
@@ -446,6 +446,8 @@
 				target_hosts:add(host);
 			end
 
+			target_hosts = target_hosts / function(target) return target:gsub("%.$", ""); end
+
 			if target_hosts:contains("localhost") then
 				print("    Target 'localhost' cannot be accessed from other servers");
 				target_hosts:remove("localhost");