From: Art Cancro Date: Mon, 30 Oct 2017 18:47:54 +0000 (-0400) Subject: DAV: getcontenttype tag belongs inside prop tag (thanks bravegnu) X-Git-Tag: v939~512 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=553af16f7e9532a5546c515acbecafe3b5f33d90 DAV: getcontenttype tag belongs inside prop tag (thanks bravegnu) --- diff --git a/webcit-ng/room_functions.c b/webcit-ng/room_functions.c index 9db3e7978..4d166e320 100644 --- a/webcit-ng/room_functions.c +++ b/webcit-ng/room_functions.c @@ -1,7 +1,7 @@ /* * Room functions * - * Copyright (c) 1996-2016 by the citadel.org team + * Copyright (c) 1996-2017 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -358,6 +358,9 @@ void propfind_the_room_itself(struct http_transaction *h, struct ctdlsession *c) StrBufAppendPrintf(Buf, "/"); StrBufXMLEscAppend(Buf, NULL, e, strlen(e), 0); StrBufAppendPrintf(Buf, ""); + StrBufAppendPrintf(Buf, ""); + StrBufAppendPrintf(Buf, "HTTP/1.1 200 OK"); + StrBufAppendPrintf(Buf, ""); switch(c->room_default_view) { case VIEW_CALENDAR: @@ -371,9 +374,6 @@ void propfind_the_room_itself(struct http_transaction *h, struct ctdlsession *c) break; } - StrBufAppendPrintf(Buf, ""); - StrBufAppendPrintf(Buf, "HTTP/1.1 200 OK"); - StrBufAppendPrintf(Buf, ""); if (timestamp > 0) { char *datestring = http_datestring(timestamp); if (datestring) { @@ -382,7 +382,7 @@ void propfind_the_room_itself(struct http_transaction *h, struct ctdlsession *c) StrBufAppendPrintf(Buf, ""); free(datestring); } - if (enumerate_by_euid) { + if (enumerate_by_euid) { // FIXME ajc 2017oct30 should this really be inside the timestamp conditional? StrBufAppendPrintf(Buf, "\"%ld\"", msglist[i]); } } diff --git a/webcit/dav_propfind.c b/webcit/dav_propfind.c index 3df13423e..b3a848a9d 100644 --- a/webcit/dav_propfind.c +++ b/webcit/dav_propfind.c @@ -13,24 +13,9 @@ * References: * http://www.ietf.org/rfc/rfc4791.txt * http://blogs.nologin.es/rickyepoderi/index.php?/archives/14-Introducing-CalDAV-Part-I.html - -Sample query: - -PROPFIND /groupdav/calendar/ HTTP/1.1 -Content-type: text/xml; charset=utf-8 -Content-length: 166 - - - - - - - - - - + * https://msdn.microsoft.com/en-us/library/aa142960(v=exchg.65).aspx * - * Copyright (c) 2005-2012 by the citadel.org team + * Copyright (c) 2005-2017 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 3. @@ -725,14 +710,18 @@ void dav_propfind(void) if (!IsEmptyStr(uid)) { wc_printf(""); - wc_printf(""); - dav_identify_host(); - wc_printf("/groupdav/"); - urlescputs(ChrPtr(WCC->CurRoom.name)); - euid_escapize(encoded_uid, uid); - wc_printf("/%s", encoded_uid); - wc_printf(""); - switch(WCC->CurRoom.defview) { + wc_printf(""); + dav_identify_host(); + wc_printf("/groupdav/"); + urlescputs(ChrPtr(WCC->CurRoom.name)); + euid_escapize(encoded_uid, uid); + wc_printf("/%s", encoded_uid); + wc_printf(""); + wc_printf(""); + wc_printf("HTTP/1.1 200 OK"); + wc_printf(""); + wc_printf("\"%ld\"", msgs[i]); + switch(WCC->CurRoom.defview) { case VIEW_CALENDAR: wc_printf("text/x-ical"); break; @@ -742,19 +731,15 @@ void dav_propfind(void) case VIEW_ADDRESSBOOK: wc_printf("text/x-vcard"); break; - } - wc_printf(""); - wc_printf("HTTP/1.1 200 OK"); - wc_printf(""); - wc_printf("\"%ld\"", msgs[i]); - if (now > 0L) { - http_datestring(datestring, sizeof datestring, now); - wc_printf(""); - escputs(datestring); - wc_printf(""); - } - wc_printf(""); - wc_printf(""); + } + if (now > 0L) { + http_datestring(datestring, sizeof datestring, now); + wc_printf(""); + escputs(datestring); + wc_printf(""); + } + wc_printf(""); + wc_printf(""); wc_printf(""); } } @@ -831,9 +816,9 @@ InitModule_PROPFIND eReadEUIDS, DavUIDL_GetParamsGetServerCall, NULL, - NULL, /// TODO: is this right? + NULL, ParseMessageListHeaders_EUID, - NULL, //// "" + NULL, DavUIDL_RenderView_or_Tail, DavUIDL_Cleanup, NULL);