// 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.
+// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License v3.
#include "webcit.h"
}
+// Method not allowed
+void do_405(struct http_transaction *h) {
+ h->response_code = 412;
+ h->response_string = strdup("METHOD NOT ALLOWED");
+}
+
+
// Precondition failed (such as if-match)
void do_412(struct http_transaction *h) {
h->response_code = 412;
// 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);
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);
}