You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2018/12/03 18:34:54 UTC
[couchdb] 05/13: Validate design document options more strictly
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 <pa...@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 <ga...@gmail.com>
Co-authored-by: Robert Newson <rn...@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}) ->