boobot: Better HEAD errors
This commit is contained in:
parent
ac51c1fb99
commit
1eedc55344
1 changed files with 3 additions and 1 deletions
|
|
@ -92,9 +92,11 @@ class BoobotBrowser(StandardBrowser):
|
||||||
r = self.openurl(HeadRequest(url))
|
r = self.openurl(HeadRequest(url))
|
||||||
body = False
|
body = False
|
||||||
except BrowserHTTPError as e:
|
except BrowserHTTPError as e:
|
||||||
if 'HTTP Error 501' in unicode(e):
|
if 'HTTP Error 501' in unicode(e) or 'HTTP Error 405' in unicode(e):
|
||||||
r = self.openurl(url)
|
r = self.openurl(url)
|
||||||
body = True
|
body = True
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
headers = r.info()
|
headers = r.info()
|
||||||
content_type = headers.get('Content-Type')
|
content_type = headers.get('Content-Type')
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue