boobot: Better HEAD errors

This commit is contained in:
Laurent Bachelier 2013-05-09 20:17:28 +02:00 committed by Romain Bignon
commit 1eedc55344

View file

@ -92,9 +92,11 @@ class BoobotBrowser(StandardBrowser):
r = self.openurl(HeadRequest(url))
body = False
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)
body = True
else:
raise e
headers = r.info()
content_type = headers.get('Content-Type')
try: