Comparison

util/prosodyctl/check.lua @ 11654:52c7a0e74bb2

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.
author Kim Alvefur <zash@zash.se>
date Sun, 04 Jul 2021 01:33:53 +0200
parent 11653:51141309ffc4
child 11655:bbf50525faa5
comparison
equal deleted inserted replaced
11653:51141309ffc4 11654:52c7a0e74bb2
444 end 444 end
445 if target_hosts:empty() then 445 if target_hosts:empty() then
446 target_hosts:add(host); 446 target_hosts:add(host);
447 end 447 end
448 448
449 target_hosts = target_hosts / function(target) return target:gsub("%.$", ""); end
450
449 if target_hosts:contains("localhost") then 451 if target_hosts:contains("localhost") then
450 print(" Target 'localhost' cannot be accessed from other servers"); 452 print(" Target 'localhost' cannot be accessed from other servers");
451 target_hosts:remove("localhost"); 453 target_hosts:remove("localhost");
452 end 454 end
453 455