couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [couchdb] 05/13: Validate design document options more strictly
Date Mon, 03 Dec 2018 18:34:54 GMT
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch feature/database-partitions
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9190ad0257386f239458f485a94b25556dde7c7f
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
AuthorDate: Wed Oct 24 11:13:29 2018 -0500

    Validate design document options more strictly
    
    This adds specific datatype requirements to the list of allowable design
    document options.
    
    Co-authored-by: Garren Smith <garren.smith@gmail.com>
    Co-authored-by: Robert Newson <rnewson@apache.org>
---
 src/couch_mrview/src/couch_mrview.erl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/couch_mrview/src/couch_mrview.erl b/src/couch_mrview/src/couch_mrview.erl
index d5b01ed..391acf4 100644
--- a/src/couch_mrview/src/couch_mrview.erl
+++ b/src/couch_mrview/src/couch_mrview.erl
@@ -57,6 +57,8 @@ validate_ddoc_fields(DDoc) ->
         [{<<"language">>, string}],
         [{<<"lists">>, object}, {any, [object, string]}],
         [{<<"options">>, object}],
+        [{<<"options">>, object}, {<<"include_design">>, boolean}],
+        [{<<"options">>, object}, {<<"local_seq">>, boolean}],
         [{<<"rewrites">>, [string, array]}],
         [{<<"shows">>, object}, {any, [object, string]}],
         [{<<"updates">>, object}, {any, [object, string]}],
@@ -133,6 +135,8 @@ validate_ddoc_field(Value, array) when is_list(Value) ->
     ok;
 validate_ddoc_field({Value}, object) when is_list(Value) ->
     ok;
+validate_ddoc_field(Value, boolean) when is_boolean(Value) ->
+    ok;
 validate_ddoc_field({Props}, {any, Type}) ->
     validate_ddoc_field1(Props, Type);
 validate_ddoc_field({Props}, {Key, Type}) ->


Mime
View raw message