From: Art Cancro Date: Sun, 5 Mar 2023 16:33:02 +0000 (-0500) Subject: Preparing to implement MOVE and COPY methods X-Git-Tag: v974~2 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=2ca84ffe19f52cfe500ae1d6a3426a100aa59ffa;p=citadel.git Preparing to implement MOVE and COPY methods --- diff --git a/webcit-ng/server/request.c b/webcit-ng/server/request.c index 605520e68..6622c28b1 100644 --- a/webcit-ng/server/request.c +++ b/webcit-ng/server/request.c @@ -4,7 +4,7 @@ // and pass control back down to the HTTP layer to output the response back to // the client. // -// Copyright (c) 1996-2022 by the citadel.org team +// Copyright (c) 1996-2023 by the citadel.org team // // This program is open source software. Use, duplication, or // disclosure are subject to the GNU General Public License v3. @@ -132,10 +132,12 @@ void perform_request(struct http_transaction *h) { // WebDAV methods like OPTIONS and PROPFIND *require* a logged-in session, // even if the Citadel server allows anonymous access. if (IsEmptyStr(c->auth)) { - if ( (!strcasecmp(h->method, "OPTIONS")) + if ( (!strcasecmp(h->method, "OPTIONS")) || (!strcasecmp(h->method, "PROPFIND")) || (!strcasecmp(h->method, "REPORT")) || (!strcasecmp(h->method, "DELETE")) + || (!strcasecmp(h->method, "MOVE")) + || (!strcasecmp(h->method, "COPY")) ) { request_http_authenticate(h); disconnect_from_citadel(c); diff --git a/webcit-ng/server/room_functions.c b/webcit-ng/server/room_functions.c index f6c843b7e..9e7896c5e 100644 --- a/webcit-ng/server/room_functions.c +++ b/webcit-ng/server/room_functions.c @@ -1,6 +1,6 @@ // Room functions // -// Copyright (c) 1996-2022 by the citadel.org team +// Copyright (c) 1996-2023 by the citadel.org team // // This program is open source software. Use, duplication, or // disclosure are subject to the GNU General Public License v3. @@ -299,6 +299,12 @@ void object_in_room(struct http_transaction *h, struct ctdlsession *c) { else if (!strcasecmp(h->method, "PUT")) { dav_put_message(h, c, unescaped_euid, msgnum); } + else if (!strcasecmp(h->method, "MOVE")) { + do_404(h); // FIXME write this + } + else if (!strcasecmp(h->method, "COPY")) { + do_404(h); // FIXME write this + } else { do_404(h); // Got this far but the method made no sense? Bummer. } @@ -330,7 +336,7 @@ void options_the_room_itself(struct http_transaction *h, struct ctdlsession *c) else { add_response_header(h, strdup("DAV"), strdup("1")); // ordinary WebDAV for all other room types } - add_response_header(h, strdup("Allow"), strdup("OPTIONS, PROPFIND, GET, PUT, REPORT, DELETE")); + add_response_header(h, strdup("Allow"), strdup("OPTIONS, PROPFIND, GET, PUT, REPORT, DELETE, MOVE, COPY")); }