check cache again on redirects

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@957 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2003-07-28 10:55:16 +00:00
parent d0f32e9f8e
commit cf17757fae
2 changed files with 9 additions and 1 deletions

View file

@ -134,7 +134,13 @@ class HttpUrlData (ProxyUrlData):
redirected = unquote(redirected)
# note: urlparts has to be a list
self.urlparts = list(urlparse.urlsplit(redirected))
# new response data
# check cache again on possibly changed URL
if self.config.urlCache_has_key(self.getCacheKey()):
self.copyFrom(self.config.urlCache_get(self.getCacheKey()))
self.cached = 1
self.logMe()
return
# new response data
response = self._getHttpResponse()
self.headers = response.msg
debug(BRING_IT_ON, "Redirected", self.headers)

View file

@ -329,6 +329,8 @@ class UrlData:
debug(BRING_IT_ON, "checking connection")
try:
self.checkConnection()
if self.cached:
return
if self.anchor and self.config["anchors"]:
self.checkAnchors(self.anchor)
except tuple(ExcList):