Add workaround for buggy IIS HEAD support.

This commit is contained in:
Bastian Kleineidam 2011-02-24 11:12:59 +01:00
parent 6130233d74
commit de5d1757f0
2 changed files with 10 additions and 3 deletions

View file

@ -1,5 +1,10 @@
6.5 "" (released xx.xx.2011)
Changes:
- checking: Use HTTP GET requests to work around buggy IIS servers
sending false positive status codes for HEAD requests.
6.4 "The Sunset Limited" (released 20.2.2011)
Fixes:

View file

@ -272,9 +272,11 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
mime = self.get_content_type()
poweredby = self.headers.get('X-Powered-By', '')
server = self.headers.get('Server', '')
if mime in ('application/octet-stream', 'text/plain') and \
(poweredby.startswith('Zope') or server.startswith('Zope')):
# Zope server could not get Content-Type with HEAD
if ((mime in ('application/octet-stream', 'text/plain') and
(poweredby.startswith('Zope') or server.startswith('Zope')))
or ('ASP.NET' in poweredby and 'Microsoft-IIS' in server)):
# Zope or IIS server could not get Content-Type with HEAD
# see http://intermapper.com.dev4.silvertech.net/bogus.aspx
self.method = "GET"
self.aliases = []
self.fallback_get = True