You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2023/03/02 13:37:21 UTC

[couchdb] branch fix/http-method-view-cleanup created (now 25db6ff25)

This is an automated email from the ASF dual-hosted git repository.

ronny pushed a change to branch fix/http-method-view-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 25db6ff25 Only allow POST request for /{db}/_view_cleanup

This branch includes the following new commits:

     new 25db6ff25 Only allow POST request for /{db}/_view_cleanup

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Only allow POST request for /{db}/_view_cleanup

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch fix/http-method-view-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 25db6ff25e3069fdfbe7fe8bb255a1af632cc334
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Thu Mar 2 14:35:48 2023 +0100

    Only allow POST request for /{db}/_view_cleanup
---
 src/chttpd/src/chttpd_db.erl | 6 ++++--
 1 file 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});