We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c02ebe0 commit 8938033Copy full SHA for 8938033
1 file changed
pytest_socket.py
@@ -199,15 +199,15 @@ def _remove_restrictions():
199
def is_valid_host(host, allowed):
200
if not host:
201
return False
202
-
+
203
ips = [ip for ip in allowed if "/" not in ip]
204
if host in ips:
205
return True
206
207
networks = [ipaddress.ip_network(mask) for mask in allowed if "/" in mask]
208
- if not networks:
+ if not networks:
209
210
211
ip = ipaddress.ip_address(host)
212
for net in networks:
213
if ip in net:
0 commit comments