Fix bug 533466 - CALDAV:calendar-multiget REPORT should not specify the calendar collection URL in the request body. r=philipp
authorBruno Browning <browning@uwalumni.com>
Thu, 10 Dec 2009 13:26:35 +0100
changeset 4506 3a201e2872acc7c3b40d379d991b6aa84da4dc27
parent 4505 4b63c4badb42c8b08b4212f195659943630b95cc
child 4507 cfd5cdb3bf177c56f53be1e0f16def24c20f5056
push id3516
push usermozilla@kewis.ch
push dateThu, 10 Dec 2009 12:26:47 +0000
treeherdercomm-central@3a201e2872ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs533466
Fix bug 533466 - CALDAV:calendar-multiget REPORT should not specify the calendar collection URL in the request body. r=philipp
calendar/providers/caldav/calDavCalendar.js
calendar/providers/caldav/calDavRequestHandlers.js
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -988,16 +988,17 @@ calDavCalendar.prototype = {
 
         let C = new Namespace("C", "urn:ietf:params:xml:ns:caldav");
         let D = new Namespace("D", "DAV:");
         default xml namespace = C;
 
         let queryXml = <D:propfind xmlns:D="DAV:">
                         <D:prop>
                             <D:getcontenttype/>
+                            <D:resourcetype/>
                             <D:getetag/>
                         </D:prop>
                        </D:propfind>;
 
         let queryString = xmlHeader + queryXml.toXMLString();
         let requestUri = this.makeUri(null, aUri)
         if (this.verboseLogging()) {
             cal.LOG("CalDAV: send(" + requestUri.spec + "): " + queryString);
--- a/calendar/providers/caldav/calDavRequestHandlers.js
+++ b/calendar/providers/caldav/calDavRequestHandlers.js
@@ -247,18 +247,21 @@ etagsHandler.prototype = {
     },
 
     endDocument: function eH_endDocument() { },
 
     startElement: function eH_startElement(aUri, aLocalName, aQName, aAttributes) {
         switch (aLocalName) {
             case "response":
                 this.currentResponse = {};
+                this.currentResponse.isCollection = false;
                 this.tag = null
                 break;
+            case "collection":
+                this.currentResponse.isCollection = true;
             case "href":
             case "getetag":
             case "status":
             case "getcontenttype":
                 this.tag = aLocalName;
                 this.currentResponse[aLocalName] = "";
                 break;
         }
@@ -271,17 +274,18 @@ etagsHandler.prototype = {
     endElement: function eH_endElement(aUri, aLocalName, aQName) {
         switch (aLocalName) {
             case "response":
                 this.tag = null;
                 let r = this.currentResponse;
                 if (r.status.indexOf(" 200") > 0 &&
                     r.getetag && r.getetag.length &&
                     r.href && r.href.length &&
-                    r.getcontenttype && r.getcontenttype.length) {
+                    r.getcontenttype && r.getcontenttype.length &&
+                    !r.isCollection) {
                     let href;
                     if (r.getcontenttype.substr(0, 14) == "message/rfc822") {
                         // workaround for a Scalix bug which causes incorrect
                         // contenttype to be returned.
                         r.getcontenttype = "text/calendar";
                     }
 
                     if (r.getcontenttype.substr(0,13) == "text/calendar") {