Support http.publish_host addresses

This commit is contained in:
epiphyte
2019-10-30 18:40:06 +01:00
committed by Honza Král
parent 4353aa2ba2
commit 71840d315a
+10 -2
View File
@@ -245,8 +245,16 @@ class Transport(object):
if not address or ":" not in address:
return None
host["host"], host["port"] = address.rsplit(":", 1)
host["port"] = int(host["port"])
if '/' in address:
# Support 7.x host/ip:port behavior where http.publish_host has been set.
fqdn, ipaddress = address.split('/', 1)
host["host"] = fqdn
_, host["port"] = ipaddress.rsplit(':', 1)
host["port"] = int(host["port"])
else:
host["host"], host["port"] = address.rsplit(":", 1)
host["port"] = int(host["port"])
return self.host_info_callback(host_info, host)