Commit f5668f66 authored by Chris Withers's avatar Chris Withers

Collector #1441: Removed headers introduced to make Microsoft webfolders and...

Collector #1441: Removed headers introduced to make Microsoft webfolders and office apps happy, since they make a lot of standards-compliant things unhappy AND they trick MS Office into trying to edit office files stored in Zope via WebDAV even when the user isn't allowed to edit them and is only trying to download them.
parent a9c89a0b
...@@ -139,6 +139,13 @@ Zope Changes ...@@ -139,6 +139,13 @@ Zope Changes
Bugs fixed Bugs fixed
- Collector #1441: Removed headers introduced to make Microsoft
webfolders and office apps happy, since they make a lot of
standards-compliant things unhappy AND they trick MS Office
into trying to edit office files stored in Zope via WebDAV even
when the user isn't allowed to edit them and is only trying to
download them.
- Collector #1445: Fixed bad interaction between -p and -v(v) - Collector #1445: Fixed bad interaction between -p and -v(v)
options to test.py that resulted in exceptions being printed options to test.py that resulted in exceptions being printed
when they shouldn't have been. when they shouldn't have been.
......
...@@ -92,9 +92,6 @@ class ZServerHTTPResponse(HTTPResponse): ...@@ -92,9 +92,6 @@ class ZServerHTTPResponse(HTTPResponse):
if headers.has_key('status'): if headers.has_key('status'):
del headers['status'] del headers['status']
if not headers.has_key("Etag"):
self.setHeader('Etag','')
# add zserver headers # add zserver headers
append('Server: %s' % self._server_version) append('Server: %s' % self._server_version)
append('Date: %s' % build_http_date(time.time())) append('Date: %s' % build_http_date(time.time()))
......
...@@ -43,7 +43,6 @@ class Collection(Resource): ...@@ -43,7 +43,6 @@ class Collection(Resource):
response.setHeader('Content-Location', location) response.setHeader('Content-Location', location)
response.setHeader('Connection', 'close', 1) response.setHeader('Connection', 'close', 1)
response.setHeader('Date', rfc1123_date(), 1) response.setHeader('Date', rfc1123_date(), 1)
response.setHeader('MS-Author-Via', 'DAV')
def HEAD(self, REQUEST, RESPONSE): def HEAD(self, REQUEST, RESPONSE):
"""Retrieve resource information without a response body.""" """Retrieve resource information without a response body."""
......
...@@ -65,14 +65,12 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem): ...@@ -65,14 +65,12 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
# Init expected HTTP 1.1 / WebDAV headers which are not # Init expected HTTP 1.1 / WebDAV headers which are not
# currently set by the base response object automagically. # currently set by the base response object automagically.
# #
# Note we set an borg-specific header for ie5 :( Also, we # We sniff for a ZServer response object, because we don't
# sniff for a ZServer response object, because we don't
# want to write duplicate headers (since ZS writes Date # want to write duplicate headers (since ZS writes Date
# and Connection itself). # and Connection itself).
if not hasattr(response, '_server_version'): if not hasattr(response, '_server_version'):
response.setHeader('Connection', 'close') response.setHeader('Connection', 'close')
response.setHeader('Date', rfc1123_date(), 1) response.setHeader('Date', rfc1123_date(), 1)
response.setHeader('MS-Author-Via', 'DAV')
# HTTP Range support # HTTP Range support
if HTTPRangeInterface.isImplementedBy(self): if HTTPRangeInterface.isImplementedBy(self):
...@@ -199,7 +197,6 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem): ...@@ -199,7 +197,6 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
self.dav__init(REQUEST, RESPONSE) self.dav__init(REQUEST, RESPONSE)
RESPONSE.setHeader('Allow', ', '.join(self.__http_methods__)) RESPONSE.setHeader('Allow', ', '.join(self.__http_methods__))
RESPONSE.setHeader('Content-Length', 0) RESPONSE.setHeader('Content-Length', 0)
RESPONSE.setHeader('DAV', '1,2', 1)
RESPONSE.setStatus(200) RESPONSE.setStatus(200)
return RESPONSE return RESPONSE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment