Fix anchor checking of cached HTTP URLs by using the cached content type.

This commit is contained in:
Bastian Kleineidam 2012-10-25 06:37:10 +02:00
parent dca52145d3
commit c44aa2db1f
2 changed files with 12 additions and 4 deletions

View file

@ -8,6 +8,10 @@ Changes:
- checking: Fix handling of non-ASCII exceptions (regression in 8.1).
Closes: SF bug #3579766
Fixes:
- checking: Fix anchor checking of cached HTTP URLs.
Closes: SF bug #3577743
8.1 "Safety Not Guaranteed" (released 14.10.2012)

View file

@ -741,21 +741,25 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledc
@return: True if URL points to HTML file
@rtype: bool
"""
if not (self.valid and self.headers):
if not self.valid:
return False
mime = self.get_content_type()
if self.ContentMimetypes.get(mime) != "html":
return False
return self.encoding_supported()
if self.headers:
return self.encoding_supported()
return True
def is_css (self):
"""Return True iff content of this url is CSS stylesheet."""
if not (self.valid and self.headers):
if not self.valid:
return False
mime = self.get_content_type()
if self.ContentMimetypes.get(mime) != "css":
return False
return self.encoding_supported()
if self.headers:
return self.encoding_supported()
return True
def is_http (self):
"""