[Zope-Checkins] CVS: Zope/lib/python/webdav - EtagSupport.py:1.5.10.2 Resource.py:1.50.10.3

Casey Duncan casey@zope.com
Thu, 19 Sep 2002 11:08:26 -0400


Update of /cvs-repository/Zope/lib/python/webdav
In directory cvs.zope.org:/tmp/cvs-serv15785/lib/python/webdav

Modified Files:
      Tag: Zope-2_5-branch
	EtagSupport.py Resource.py 
Log Message:
Collector #574: Fixed write on HEAD requests caused by overzealous ETag support.


=== Zope/lib/python/webdav/EtagSupport.py 1.5.10.1 => 1.5.10.2 ===
--- Zope/lib/python/webdav/EtagSupport.py:1.5.10.1	Tue Mar 12 19:54:30 2002
+++ Zope/lib/python/webdav/EtagSupport.py	Thu Sep 19 11:08:25 2002
@@ -66,9 +66,11 @@
     """
     __implements__ = (EtagBaseInterface,)
 
-    def http__etag(self):
+    def http__etag(self, readonly=0):
         try: etag = self.__etag
         except AttributeError:
+            if readonly: # Don't refresh on read
+                return
             self.http__refreshEtag()
             etag = self.__etag
         return etag


=== Zope/lib/python/webdav/Resource.py 1.50.10.2 => 1.50.10.3 ===
--- Zope/lib/python/webdav/Resource.py:1.50.10.2	Thu Aug 29 09:12:22 2002
+++ Zope/lib/python/webdav/Resource.py	Thu Sep 19 11:08:25 2002
@@ -167,7 +167,9 @@
             mtime=rfc1123_date(self._p_mtime)
             RESPONSE.setHeader('Last-Modified', mtime)
         if hasattr(aq_base(self), 'http__etag'):
-            RESPONSE.setHeader('Etag', self.aq_base.http__etag())
+            etag = self.http__etag(readonly=1)
+            if etag:
+                RESPONSE.setHeader('Etag', etag)
         RESPONSE.setStatus(200)
         return RESPONSE