diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2018-10-24 11:13:29 -0500 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2019-01-03 15:47:37 -0600 |
commit | cb7e72edc6260471fe82f481213bf3dbfd0cf8ea (patch) | |
tree | 4da87ff25044469b63025fdc36b902fda4367713 | |
parent | ff77a343606388fb9f016410a088bea9c23c045f (diff) | |
download | couchdb-cb7e72edc6260471fe82f481213bf3dbfd0cf8ea.tar.gz |
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>
-rw-r--r-- | src/couch_mrview/src/couch_mrview.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/couch_mrview/src/couch_mrview.erl b/src/couch_mrview/src/couch_mrview.erl index d5b01ed7c..391acf412 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}) -> |