upload: change REST path from /ctdl/a/upload/ to /ctdl/p/
[citadel.git] / webcit-ng / server / upload.c
index 1d7fbf95676ae64710160d03b7753ccb4a3acd41..9fd363838e3cf6ff3d0a20b5e9cf7630385e2711 100644 (file)
@@ -1,6 +1,6 @@
 // Upload handler
 //
-// 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.
@@ -70,4 +70,15 @@ void upload_files(struct http_transaction *h, struct ctdlsession *c) {
        h->response_string = strdup("OK");
        h->response_body_length = StrLength(sj);
        h->response_body = SmashStrBuf(&sj);
-}
\ No newline at end of file
+}
+
+
+// Dispatcher for paths starting with /ctdl/p/
+void ctdl_p(struct http_transaction *h, struct ctdlsession *c) {
+       if (!strcasecmp(h->url, "/ctdl/p/")) {          // upload files
+               upload_files(h, c);
+               return;
+       }
+
+       do_404(h);                                      // unknown
+}