Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pytest_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def socket_allow_hosts(allowed=None, allow_unix_socket=False):

def guarded_connect(inst, *args):
host = host_from_connect_args(args)
if host and not is_ipaddress(host):
host = resolve_hostname(host)
if host in allowed_hosts or (
_is_unix_socket(inst.family) and allow_unix_socket
):
Expand Down