mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
Add WebDAV move stub
PUBLISHED_FROM=b1f712862b81dfe8da6547338f77ff3bfefa5051
This commit is contained in:
1 parent
cfe80ba9b7
commit
a68e0d9a3f
1 file changed
+17
-1
+17
-1
@@ -5527,6 +5527,20 @@ static int remove_directory(const struct mg_serve_http_opts *opts,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_move(struct mg_connection *nc,
|
||||||
|
const struct mg_serve_http_opts *opts, const char *path,
|
||||||
|
struct http_message *hm) {
|
||||||
|
/*
|
||||||
|
* This method is not implemented now, but at least
|
||||||
|
* we have to send error 501
|
||||||
|
*/
|
||||||
|
(void) nc;
|
||||||
|
(void) opts;
|
||||||
|
(void) path;
|
||||||
|
(void) hm;
|
||||||
|
send_http_error(nc, 501, "Not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
static void handle_delete(struct mg_connection *nc,
|
static void handle_delete(struct mg_connection *nc,
|
||||||
const struct mg_serve_http_opts *opts,
|
const struct mg_serve_http_opts *opts,
|
||||||
const char *path) {
|
const char *path) {
|
||||||
@@ -5606,7 +5620,7 @@ static void handle_put(struct mg_connection *nc, const char *path,
|
|||||||
|
|
||||||
static int is_dav_request(const struct mg_str *s) {
|
static int is_dav_request(const struct mg_str *s) {
|
||||||
return !mg_vcmp(s, "PUT") || !mg_vcmp(s, "DELETE") || !mg_vcmp(s, "MKCOL") ||
|
return !mg_vcmp(s, "PUT") || !mg_vcmp(s, "DELETE") || !mg_vcmp(s, "MKCOL") ||
|
||||||
!mg_vcmp(s, "PROPFIND");
|
!mg_vcmp(s, "PROPFIND") || !mg_vcmp(s, "MOVE");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -6293,6 +6307,8 @@ void mg_send_http_file(struct mg_connection *nc, char *path,
|
|||||||
handle_delete(nc, opts, path);
|
handle_delete(nc, opts, path);
|
||||||
} else if (!mg_vcmp(&hm->method, "PUT")) {
|
} else if (!mg_vcmp(&hm->method, "PUT")) {
|
||||||
handle_put(nc, path, hm);
|
handle_put(nc, path, hm);
|
||||||
|
} else if (!mg_vcmp(&hm->method, "MOVE")) {
|
||||||
|
handle_move(nc, opts, path, hm);
|
||||||
#endif
|
#endif
|
||||||
} else if (!mg_vcmp(&hm->method, "OPTIONS")) {
|
} else if (!mg_vcmp(&hm->method, "OPTIONS")) {
|
||||||
send_options(nc);
|
send_options(nc);
|
||||||
|
|||||||
Reference in new issue
Block a user