Software /
code /
prosody
Diff
prosodyctl @ 10257:26afb1a6d086 0.11
prosodyctl: Fix traceback on incorrect proxy65_address type
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 11 Sep 2019 15:03:54 +0100 |
parent | 9991:8cd180dc18a8 |
child | 10270:c2b9ff42db03 |
child | 10432:7b5a3de26f57 |
line wrap: on
line diff
--- a/prosodyctl Thu Sep 05 16:01:16 2019 +0100 +++ b/prosodyctl Wed Sep 11 15:03:54 2019 +0100 @@ -1103,17 +1103,21 @@ if modules:contains("proxy65") then local proxy65_target = configmanager.get(host, "proxy65_address") or host; - local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA"); - local prob = {}; - if not A then - table.insert(prob, "A"); - end - if v6_supported and not AAAA then - table.insert(prob, "AAAA"); - end - if #prob > 0 then - print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/") - .." record. Create one or set 'proxy65_address' to the correct host/IP."); + if type(proxy65_target) == "string" then + local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA"); + local prob = {}; + if not A then + table.insert(prob, "A"); + end + if v6_supported and not AAAA then + table.insert(prob, "AAAA"); + end + if #prob > 0 then + print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/") + .." record. Create one or set 'proxy65_address' to the correct host/IP."); + end + else + print(" proxy65_address for "..host.." should be set to a string, unable to perform DNS check"); end end