[CalendarServer-changes] [726]
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.
put_common.patch
source_changes at macosforge.org
source_changes at macosforge.org
Wed Dec 6 11:56:15 PST 2006
Revision: 726
http://trac.macosforge.org/projects/calendarserver/changeset/726
Author: cdaboo at apple.com
Date: 2006-12-06 11:56:14 -0800 (Wed, 06 Dec 2006)
Log Message:
-----------
Fix to ensure content-type on PUT is stored as getcontenttype property.
Modified Paths:
--------------
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.put_common.patch
Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.put_common.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.put_common.patch 2006-12-06 19:34:32 UTC (rev 725)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.put_common.patch 2006-12-06 19:56:14 UTC (rev 726)
@@ -2,7 +2,7 @@
===================================================================
--- twisted/web2/dav/method/put_common.py (revision 0)
+++ twisted/web2/dav/method/put_common.py (revision 0)
-@@ -0,0 +1,252 @@
+@@ -0,0 +1,259 @@
+##
+# Copyright (c) 2005-2006 Apple Computer, Inc. All rights reserved.
+#
@@ -33,6 +33,7 @@
+from twisted.python import failure, log
+from twisted.python.filepath import FilePath
+from twisted.web2 import responsecode
++from twisted.web2.dav import davxml
+from twisted.web2.dav.fileop import copy, delete, put
+from twisted.web2.dav.resource import TwistedGETContentMD5
+from twisted.web2.dav.stream import MD5StreamWrapper
@@ -215,6 +216,12 @@
+ md5 = md5.getMD5()
+ destination.writeDeadProperty(TwistedGETContentMD5.fromString(md5))
+
++ # Update the content-type value on the resource if it is new
++ if source is None:
++ content_type = request.headers.getHeader("content-type")
++ if content_type is not None:
++ destination.writeDeadProperty(davxml.GETContentType.fromString("%s/%s" % (content_type.mediaType, content_type.mediaSubtype,)))
++
+ response = IResponse(response)
+
+ # Do quota check on destination
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061206/69f8a435/attachment.html
More information about the calendarserver-changes
mailing list