Skip to content

Commit

Permalink
Add timeout to request.head
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotkk committed May 15, 2024
1 parent aca12b1 commit 622d42f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def to_dict(self):

def url_ok(url) -> bool:
try:
r = requests.head(url)
r = requests.head(url, timeout=10)
return bool(r.status_code)
except requests.exceptions.ConnectionError:
return False
Expand Down

0 comments on commit 622d42f

Please sign in to comment.