Remove Amazon quirk because the default behaviour handles this now.

This commit is contained in:
Bastian Kleineidam 2012-08-23 05:36:51 +02:00
parent 02a9f0bacb
commit e252bbf623
2 changed files with 0 additions and 12 deletions

View file

@ -49,9 +49,6 @@ supportHttps = hasattr(httplib, "HTTPSConnection")
_supported_encodings = ('gzip', 'x-gzip', 'deflate')
# Amazon blocks all HEAD requests
_is_amazon = re.compile(r'^www\.amazon\.(com|de|ca|fr|co\.(uk|jp))').search
class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
"""
@ -142,13 +139,6 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
self.method_get_allowed = False
# first try with HEAD
self.method = "HEAD"
# check for amazon server quirk
if _is_amazon(self.urlparts[1]):
if self.method_get_allowed:
self.method = "GET"
else:
# XXX make this a warning instead
self.add_info(_("Amazon servers block HTTP HEAD requests."))
# check the http connection
response = self.check_http_connection()
# redirections might have changed the URL

View file

@ -33,8 +33,6 @@ class TestHttps (LinkCheckTest):
u"url %s" % url,
u"cache key %s" % url,
u"real url %s" % url,
u"info Amazon servers block HTTP HEAD requests.",
u"info Using GET method for Amazon server.",
u"valid",
]
self.direct(url, resultlines)