Skip to content

Commit

Permalink
correct IPv4/IPv6 address output
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiering committed Mar 14, 2024
1 parent beb33fe commit 10dd5af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion radicale/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def format_address(address: ADDRESS_TYPE) -> str:
if not isinstance(host, str):
raise NotImplementedError("Unsupported address format: %r" %
(address,))
return "[%s]:%d" % (host, port)
if host.find(":") == -1:
return "%s:%d" % (host, port)
else:
return "[%s]:%d" % (host, port)


class ParallelHTTPServer(socketserver.ThreadingMixIn,
Expand Down

0 comments on commit 10dd5af

Please sign in to comment.