[CalendarServer-changes] [5020] CalendarServer/branches/users/glyph/contacts-server-merge/ twistedcaldav/method/mkcol.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 2 18:36:26 PST 2010


Revision: 5020
          http://trac.macosforge.org/projects/calendarserver/changeset/5020
Author:   glyph at apple.com
Date:     2010-02-02 18:36:26 -0800 (Tue, 02 Feb 2010)
Log Message:
-----------
Unit tests assert that extended MKCOL should result in UNSUPPORTED_MEDIA_TYPE, not BAD_REQUEST, just like regular MKCOL.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/contacts-server-merge/twistedcaldav/method/mkcol.py

Modified: CalendarServer/branches/users/glyph/contacts-server-merge/twistedcaldav/method/mkcol.py
===================================================================
--- CalendarServer/branches/users/glyph/contacts-server-merge/twistedcaldav/method/mkcol.py	2010-02-03 00:28:12 UTC (rev 5019)
+++ CalendarServer/branches/users/glyph/contacts-server-merge/twistedcaldav/method/mkcol.py	2010-02-03 02:36:26 UTC (rev 5020)
@@ -1,3 +1,4 @@
+# -*- test-case-name: twistedcaldav.test.test_DAV.MKCOL -*-
 ##
 # Copyright (c) 2005-2010 Apple Inc. All rights reserved.
 #
@@ -94,7 +95,14 @@
         doc = (yield davXMLFromStream(request.stream))
     except ValueError, e:
         log.err("Error while handling MKCOL: %s" % (e,))
-        raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, str(e)))
+        # TODO: twisted.web2.dav 'MKCOL' tests demand this particular response
+        # code, but should we really be looking at the XML content or the
+        # content-type header?  It seems to me like this ought to be considered
+        # a BAD_REQUEST if it claims to be XML but isn't, but an
+        # UNSUPPORTED_MEDIA_TYPE if it claims to be something else. -glyph
+        raise HTTPError(
+            StatusResponse(responsecode.UNSUPPORTED_MEDIA_TYPE, str(e))
+        )
 
     if doc is not None:
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100202/01f90f14/attachment.html>


More information about the calendarserver-changes mailing list