[CalendarServer-changes] [4448] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Fri Jul 10 09:13:41 PDT 2009


Revision: 4448
          http://trac.macosforge.org/projects/calendarserver/changeset/4448
Author:   cdaboo at apple.com
Date:     2009-07-10 09:13:41 -0700 (Fri, 10 Jul 2009)
Log Message:
-----------
Make sure implicit writes to the Inbox are treated as "internal requests" and make sure that such requests
always use a text/calendar content-type for the resource written - not the content-type from the request.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/method/put_common.py
    CalendarServer/trunk/twistedcaldav/scheduling/caldav.py

Modified: CalendarServer/trunk/twistedcaldav/method/put_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/put_common.py	2009-07-10 02:24:26 UTC (rev 4447)
+++ CalendarServer/trunk/twistedcaldav/method/put_common.py	2009-07-10 16:13:41 UTC (rev 4448)
@@ -41,7 +41,7 @@
 from twisted.web2.dav.util import joinURL, parentForURL
 from twisted.web2.http import HTTPError
 from twisted.web2.http import StatusResponse
-from twisted.web2.http_headers import generateContentType
+from twisted.web2.http_headers import generateContentType, MimeType
 from twisted.web2.iweb import IResponse
 from twisted.web2.stream import MemoryStream
 
@@ -907,10 +907,10 @@
             raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "valid-calendar-data"), description=msg))
 
         content_type = self.request.headers.getHeader("content-type")
-        if content_type is not None:
+        if not self.internal_request and content_type is not None:
             self.destination.writeDeadProperty(davxml.GETContentType.fromString(generateContentType(content_type)))
         else:
-            self.destination.writeDeadProperty(davxml.GETContentType.fromString("text/calendar"))
+            self.destination.writeDeadProperty(davxml.GETContentType.fromString(generateContentType(MimeType("text", "calendar", params={"charset":"utf-8"}))))
         return None
 
     def doRemoveDestinationIndex(self):

Modified: CalendarServer/trunk/twistedcaldav/scheduling/caldav.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/caldav.py	2009-07-10 02:24:26 UTC (rev 4447)
+++ CalendarServer/trunk/twistedcaldav/scheduling/caldav.py	2009-07-10 16:13:41 UTC (rev 4448)
@@ -164,7 +164,8 @@
                              destinationparent = recipient.inbox,
                              destinationcal = True,
                              calendar = self.scheduler.calendar,
-                             isiTIP = True
+                             isiTIP = True,
+                             internal_request = True,
                          ).run()
             except:
                 # FIXME: Bare except
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090710/75cbbe40/attachment.html>


More information about the calendarserver-changes mailing list