Skip to content

Commit

Permalink
fix: Fix resolving named hosts.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwardrop committed Apr 1, 2023
1 parent 0071d14 commit 9f7c4b7
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 9f7c4b7

Please sign in to comment.