mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-30 02:54:42 +00:00
Fix anchor checking of cached HTTP URLs by using the cached content type.
This commit is contained in:
parent
dca52145d3
commit
c44aa2db1f
2 changed files with 12 additions and 4 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue