diff options
author | Ronny Berndt <ronny@apache.org> | 2023-03-02 15:15:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-02 15:15:09 +0100 |
commit | c0b8839bf28bd2c914d71a4dfafd3ea508c3040a (patch) | |
tree | 67107a57142c95a04330a0253b2ed19279a0c39f | |
parent | 54879f9a5d093b8000d64070e7de323e155f2a2a (diff) | |
download | couchdb-c0b8839bf28bd2c914d71a4dfafd3ea508c3040a.tar.gz |
Only allow POST request for /{db}/_view_cleanup (#4449)
-rw-r--r-- | src/chttpd/src/chttpd_db.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl index db506e8e2..f2bf447b7 100644 --- a/src/chttpd/src/chttpd_db.erl +++ b/src/chttpd/src/chttpd_db.erl @@ -308,9 +308,11 @@ handle_compact_req(#httpd{method = 'POST'} = Req, Db) -> handle_compact_req(Req, _Db) -> send_method_not_allowed(Req, "POST"). -handle_view_cleanup_req(Req, Db) -> +handle_view_cleanup_req(#httpd{method = 'POST'} = Req, Db) -> ok = fabric:cleanup_index_files_all_nodes(Db), - send_json(Req, 202, {[{ok, true}]}). + send_json(Req, 202, {[{ok, true}]}); +handle_view_cleanup_req(Req, _Db) -> + send_method_not_allowed(Req, "POST"). handle_partition_req(#httpd{path_parts = [_, _]} = _Req, _Db) -> throw({bad_request, invalid_partition_req}); |