mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
Enforce DELETE request
This commit is contained in:
1 parent
706f4787e2
commit
b4ca50b3c6
3 files changed
+25
-6
No files matched your search
+5
-1
@@ -609,7 +609,11 @@ void mg_dash_ev_handler(struct mg_connection *c, int ev, void *ev_data) {
|
||||
mg_serve_fs(c, hm, u, false);
|
||||
} else if (mg_match(hm->uri, mg_str("/api/del/*/*/*"), parts) ||
|
||||
mg_match(hm->uri, mg_str("/api/del/*/*"), parts)) {
|
||||
mg_dash_handle_del(c, dash, u, parts);
|
||||
if (mg_strcmp(hm->method, mg_str("DELETE")) == 0) {
|
||||
mg_dash_handle_del(c, dash, u, parts);
|
||||
} else {
|
||||
mg_http_reply(c, 405, "Allow: DELETE\r\n", "Method Not Allowed\n");
|
||||
}
|
||||
} else if (mg_match(hm->uri, mg_str("/api/add/*"), parts)) {
|
||||
mg_dash_handle_add(c, dash, u, parts, hm->body);
|
||||
} else if (mg_match(hm->uri, mg_str("/api/get/*/*"), parts) &&
|
||||
|
||||
Reference in new issue
Block a user