mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-04 18:22:26 +00:00
correct IPv4/IPv6 address output
This commit is contained in:
parent
efd562b38d
commit
b16bc212f6
1 changed files with 4 additions and 1 deletions
|
@ -67,6 +67,9 @@ def format_address(address: ADDRESS_TYPE) -> str:
|
|||
if not isinstance(host, str):
|
||||
raise NotImplementedError("Unsupported address format: %r" %
|
||||
(address,))
|
||||
if host.find(":") == -1:
|
||||
return "%s:%d" % (host, port)
|
||||
else:
|
||||
return "[%s]:%d" % (host, port)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue