mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-24 16:14:45 +00:00
Work around a squid bug resulting in not detecting broken links
This commit is contained in:
parent
e99c55f6c4
commit
6e1e9148d8
2 changed files with 13 additions and 4 deletions
|
|
@ -3,6 +3,9 @@
|
|||
Fixes:
|
||||
- checking: Properly handle non-ascii HTTP header values.
|
||||
Closes: SF bug #3473359
|
||||
- checking: Work around a squid bug which resulted in not detecting
|
||||
broken links.
|
||||
Closes: SF bug #3472341
|
||||
|
||||
Changes:
|
||||
- checking: Add steam:// URIs to the list of ignored URIs.
|
||||
|
|
|
|||
|
|
@ -260,11 +260,17 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
"Authentication %s/%s", _user, _password)
|
||||
continue
|
||||
elif response.status >= 400:
|
||||
# retry with GET (but do not set fallback flag)
|
||||
# Retry with GET, but do not set fallback_get flag.
|
||||
# This ensures that sites that do not properly support HEAD
|
||||
# requests do not give false errors.
|
||||
if self.method == "HEAD" and self.method_get_allowed:
|
||||
self.method = "GET"
|
||||
self.aliases = []
|
||||
continue
|
||||
# The squid proxy reports valid 200 instead of 404 due to
|
||||
# garbage sent from the server at the start of the GET
|
||||
# request. See http://www.aldec.com/Products
|
||||
if u'squid' not in self.headers.get('Via', '').lower():
|
||||
self.method = "GET"
|
||||
self.aliases = []
|
||||
continue
|
||||
elif self.headers and self.method == "HEAD" and self.method_get_allowed:
|
||||
# test for HEAD support
|
||||
mime = self.get_content_type()
|
||||
|
|
|
|||
Loading…
Reference in a new issue