fall back to GET on bad status line

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1317 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-05-26 23:00:21 +00:00
parent 3ab3dcb186
commit abccff16ea

View file

@ -124,7 +124,16 @@ class HttpUrlData (ProxyUrlData):
fallback = False
redirectCache = [self.url]
while True:
response = self._getHttpResponse()
try:
response = self._getHttpResponse()
except httplib2.BadStatusLine:
# some servers send empty HEAD replies
if self.method=="HEAD":
self.method = "GET"
redirectCache = [self.url]
fallback = True
continue
raise
self.headers = response.msg
debug(BRING_IT_ON, response.status, response.reason, self.headers)
# proxy enforcement (overrides standard proxy)