We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fce98ab + 8938033 commit 4ca2c48Copy full SHA for 4ca2c48
1 file changed
pytest_socket.py
@@ -209,15 +209,15 @@ def _remove_restrictions():
209
def is_valid_host(host, allowed):
210
if not host:
211
return False
212
-
+
213
ips = [ip for ip in allowed if "/" not in ip]
214
if host in ips:
215
return True
216
217
networks = [ipaddress.ip_network(mask) for mask in allowed if "/" in mask]
218
- if not networks:
+ if not networks:
219
220
221
ip = ipaddress.ip_address(host)
222
for net in networks:
223
if ip in net:
0 commit comments