better detection of redirect errors
parent
e7670c9e40
commit
5ce361b81e
|
@ -37,7 +37,7 @@ class ContentTyper(object):
|
||||||
r.status_code = 511
|
r.status_code = 511
|
||||||
return r
|
return r
|
||||||
except requests.exceptions.ConnectionError as ce:
|
except requests.exceptions.ConnectionError as ce:
|
||||||
if '[Errno 8]' in str(ce):
|
if '[Errno 8]' in str(ce) or [Errno -2] in str(ce):
|
||||||
try:
|
try:
|
||||||
r = requests.get(url, allow_redirects=False, headers=HEADERS)
|
r = requests.get(url, allow_redirects=False, headers=HEADERS)
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Reference in New Issue