mirror of
https://github.com/apache/superset.git
synced 2024-09-07 06:17:45 -04:00
fix(utils): use getaddrinfo for hostname check to support ipv6 (#21042)
This commit is contained in:
parent
222f1e7ea8
commit
2aa3bb6c00
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user