[CalendarServer-changes] [6280] CalendarServer/trunk/twext/web2
source_changes at macosforge.org
source_changes at macosforge.org
Fri Sep 10 19:06:56 PDT 2010
Revision: 6280
http://trac.macosforge.org/projects/calendarserver/changeset/6280
Author: cdaboo at apple.com
Date: 2010-09-10 19:06:55 -0700 (Fri, 10 Sep 2010)
Log Message:
-----------
Return 304 instead of 412 for modified pre-condition test failures.
Modified Paths:
--------------
CalendarServer/trunk/twext/web2/http.py
CalendarServer/trunk/twext/web2/test/test_http.py
Modified: CalendarServer/trunk/twext/web2/http.py
===================================================================
--- CalendarServer/trunk/twext/web2/http.py 2010-09-11 02:06:05 UTC (rev 6279)
+++ CalendarServer/trunk/twext/web2/http.py 2010-09-11 02:06:55 UTC (rev 6280)
@@ -311,12 +311,7 @@
raise HTTPError(StatusResponse(responsecode.PRECONDITION_FAILED, "Requested resource has a matching ETag."))
else:
if notModified == True:
- if request.method in ("HEAD", "GET"):
- raise HTTPError(NotModifiedResponse(response))
- else:
- # S14.25 doesn't actually say what to do for a failing IMS on
- # non-GET methods. But Precondition Failed makes sense to me.
- raise HTTPError(StatusResponse(responsecode.PRECONDITION_FAILED, "Requested resource has not changed."))
+ raise HTTPError(NotModifiedResponse(response))
def checkIfRange(request, response):
"""Checks for the If-Range header, and if it exists, checks if the
Modified: CalendarServer/trunk/twext/web2/test/test_http.py
===================================================================
--- CalendarServer/trunk/twext/web2/test/test_http.py 2010-09-11 02:06:05 UTC (rev 6279)
+++ CalendarServer/trunk/twext/web2/test/test_http.py 2010-09-11 02:06:55 UTC (rev 6280)
@@ -137,7 +137,7 @@
# With a non-GET method
request.method="PUT"
- self.checkPreconditions(request, response, False, responsecode.PRECONDITION_FAILED)
+ self.checkPreconditions(request, response, False, responsecode.NOT_MODIFIED)
request.method="GET"
request.headers.setRawHeaders("If-Modified-Since", ('Sat, 01 Jan 2000 00:00:00 GMT',))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100910/7e36ff1e/attachment-0001.html>
More information about the calendarserver-changes
mailing list