[CalendarServer-changes] [4854] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Dec 10 19:34:11 PST 2009
Revision: 4854
http://trac.macosforge.org/projects/calendarserver/changeset/4854
Author: cdaboo at apple.com
Date: 2009-12-10 19:34:10 -0800 (Thu, 10 Dec 2009)
Log Message:
-----------
Generate 403 for invalid VFREEBUSY containing non-UTC DTSTART and DTEND.
Modified Paths:
--------------
CalendarServer/trunk/support/build.sh
CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py
Modified: CalendarServer/trunk/support/build.sh
===================================================================
--- CalendarServer/trunk/support/build.sh 2009-12-11 03:30:07 UTC (rev 4853)
+++ CalendarServer/trunk/support/build.sh 2009-12-11 03:34:10 UTC (rev 4854)
@@ -496,7 +496,7 @@
false true true true 212;
# Tool dependencies. The code itself doesn't depend on these, but you probably want them.
- svn_get "CalDAVTester" "${top}/CalDAVTester" "${svn_uri_base}/CalDAVTester/trunk" 4822;
+ svn_get "CalDAVTester" "${top}/CalDAVTester" "${svn_uri_base}/CalDAVTester/trunk" 4853;
svn_get "Pyflakes" "${top}/Pyflakes" http://divmod.org/svn/Divmod/trunk/Pyflakes 17198;
}
Modified: CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py 2009-12-11 03:30:07 UTC (rev 4853)
+++ CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py 2009-12-11 03:34:10 UTC (rev 4854)
@@ -26,7 +26,7 @@
from twisted.web2.http import HTTPError, Response, StatusResponse
from twisted.web2.http_headers import MimeType
-from twistedcaldav import caldavxml
+from twistedcaldav import caldavxml, dateops
from twistedcaldav.accounting import accountingEnabled, emitAccounting
from twistedcaldav.caldavxml import caldav_namespace, TimeRange
from twistedcaldav.config import config
@@ -295,7 +295,13 @@
if dtstart is None or dtend is None:
log.err("VFREEBUSY start/end not valid: %s" % (self.calendar,))
raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "valid-calendar-data"), description="VFREEBUSY start/end not valid"))
- self.timeRange = TimeRange(start="20000101T000000Z", end="20070102T000000Z")
+
+ # Some clients send floating instead of UTC - coerce to UTC
+ if dtstart.tzinfo is None or dtend.tzinfo is None:
+ log.err("VFREEBUSY start or end not UTC: %s" % (self.calendar,))
+ raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "valid-calendar-data"), description="VFREEBUSY start or end not UTC"))
+
+ self.timeRange = TimeRange(start=dateops.toString(dtstart), end=dateops.toString(dtend))
self.timeRange.start = dtstart
self.timeRange.end = dtend
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091210/a81ab657/attachment.html>
More information about the calendarserver-changes
mailing list