mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(utils): use getaddrinfo for hostname check to support ipv6 (#21042)
This commit is contained in:
@@ -44,7 +44,7 @@ def is_hostname_valid(host: str) -> bool:
|
||||
Test if a given hostname can be resolved.
|
||||
"""
|
||||
try:
|
||||
socket.gethostbyname(host)
|
||||
socket.getaddrinfo(host, None)
|
||||
return True
|
||||
except socket.gaierror:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user