You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2022/09/01 14:54:26 UTC

[couchdb] branch bulk_get_input_validation created (now 187be8f78)

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

rnewson pushed a change to branch bulk_get_input_validation
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 187be8f78 return a nice error if non-object passed to _bulk_get

This branch includes the following new commits:

     new 187be8f78 return a nice error if non-object passed to _bulk_get

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: return a nice error if non-object passed to _bulk_get

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

rnewson pushed a commit to branch bulk_get_input_validation
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 187be8f78a54a539e32d92b805d08bfbb3f73dd4
Author: Robert Newson <rn...@apache.org>
AuthorDate: Thu Sep 1 15:54:04 2022 +0100

    return a nice error if non-object passed to _bulk_get
---
 src/chttpd/src/chttpd_db.erl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index c41c82347..14049bd78 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -2393,7 +2393,10 @@ throw_bad_query_param(Key) when is_binary(Key) ->
     throw({bad_request, Msg}).
 
 bulk_get_open_doc_revs(Db, {Props}, Options) ->
-    bulk_get_open_doc_revs1(Db, Props, Options, {}).
+    bulk_get_open_doc_revs1(Db, Props, Options, {});
+bulk_get_open_doc_revs(_Db, _Invalid, Options) ->
+    Error = {null, bad_request, <<"document must be a JSON object">>},
+    {null, {error, Error}, Options}.
 
 bulk_get_open_doc_revs1(Db, Props, Options, {}) ->
     case couch_util:get_value(<<"id">>, Props) of