You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several errors when using the --connect page due to the non existence of error handling in the head_request class.
To avoid connection timeouts i have added a two seconds timeout for each domain, and i have additionally passed every exception occuring (there will be at leas two errors at the current script:
ConnectionRefusedError
ConnectionTimedoutError
I have changed the code a bit as a suggestion, for the usability i'd handle the exceptions accordingly and maybe set the timeout as an argument for the user :-)
Hey guys!
There are several errors when using the --connect page due to the non existence of error handling in the head_request class.
To avoid connection timeouts i have added a two seconds timeout for each domain, and i have additionally passed every exception occuring (there will be at leas two errors at the current script:
I have changed the code a bit as a suggestion, for the usability i'd handle the exceptions accordingly and maybe set the timeout as an argument for the user :-)
def head_request(url):
try:
conn = http.client.HTTPConnection(url,timeout=2)
conn.request("HEAD", "/")
except:
return []
resp = conn.getresponse()
conn.close()
best
Patrik
The text was updated successfully, but these errors were encountered: