correct IPv4/IPv6 address output
This commit is contained in:
@@ -67,7 +67,10 @@ def format_address(address: ADDRESS_TYPE) -> str:
|
|||||||
if not isinstance(host, str):
|
if not isinstance(host, str):
|
||||||
raise NotImplementedError("Unsupported address format: %r" %
|
raise NotImplementedError("Unsupported address format: %r" %
|
||||||
(address,))
|
(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,
|
class ParallelHTTPServer(socketserver.ThreadingMixIn,
|
||||||
|
|||||||
Reference in New Issue
Block a user