]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/server/request.c
Everyone who designed CalDAV deserves torture and ultra-violent death.
[citadel.git] / webcit-ng / server / request.c
index c0fa86b2cb9568d06e714a1560d4ae724e9410f0..ee08578dc6671df64434b1320b9df548bbe7929c 100644 (file)
@@ -6,8 +6,7 @@
 //
 // Copyright (c) 1996-2023 by the citadel.org team
 //
-// This program is open source software.  Use, duplication, or
-// disclosure is subject to the GNU General Public License v3.
+// This program is open source software.  Use, duplication, or disclosure is subject to the GNU General Public License v3.
 
 #include "webcit.h"
 
@@ -95,6 +94,18 @@ void perform_request(struct http_transaction *h) {
                return;
        }
 
+       // CalDAV discovery
+       if (!strncasecmp(h->url, HKEY("/.well-known/caldav"))) {
+               http_redirect(h, "/ctdl/r/calendar");
+               return;
+       }
+
+       // CardDAV discovery
+       if (!strncasecmp(h->url, HKEY("/.well-known/carddav"))) {
+               http_redirect(h, "/ctdl/r/contacts");
+               return;
+       }
+
        // Legacy URL patterns (/readnew?gotoroom=xxx&start_reading_at=yyy) ...
        // Direct room name (/my%20blog) ...