[CalendarServer-changes] [7270] CalendarServer/trunk/twistedcaldav/resource.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 29 08:11:03 PDT 2011


Revision: 7270
          http://trac.macosforge.org/projects/calendarserver/changeset/7270
Author:   cdaboo at apple.com
Date:     2011-03-29 08:11:03 -0700 (Tue, 29 Mar 2011)
Log Message:
-----------
Make sure the current etag is always used ahead of any schedule-etags in a pre-condition check.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/resource.py

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2011-03-29 14:03:50 UTC (rev 7269)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2011-03-29 15:11:03 UTC (rev 7270)
@@ -1403,6 +1403,9 @@
                     # This is almost verbatim from twext.web2.static.checkPreconditions
                     if request.method not in ("GET", "HEAD"):
                         
+                        # Always test against the current etag first just in case schedule-etags is out of sync
+                        etags = (self.etag(), ) + tuple([http_headers.ETag(etag) for etag in etags])
+
                         # Loop over each tag and succeed if any one matches, else re-raise last exception
                         exists = self.exists()
                         last_modified = self.lastModified()
@@ -1412,7 +1415,7 @@
                                 http.checkPreconditions(
                                     request,
                                     entityExists = exists,
-                                    etag = http_headers.ETag(etag),
+                                    etag = etag,
                                     lastModified = last_modified,
                                 )
                             except HTTPError, e:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110329/7be455fa/attachment.html>


More information about the calendarserver-changes mailing list