]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/server/request.c
upload: change REST path from /ctdl/a/upload/ to /ctdl/p/
[citadel.git] / webcit-ng / server / request.c
index 605520e68f8debb0d8d961c9f24feb5d709538ac..4b8b3b1d1363a80d2e995e51bbbd0ebf961ddd08 100644 (file)
@@ -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);
@@ -160,6 +162,9 @@ void perform_request(struct http_transaction *h) {
        case 'u':               // /ctdl/u/ == RESTful path to users
                ctdl_u(h, c);
                break;
+       case 'p':               // /ctdl/p/ == RESTful path to upload functions
+               ctdl_p(h, c);
+               break;
        default:
                do_404(h);
        }