summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_view.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r--src/couchdb/couch_httpd_view.erl23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl
index e0c3f631..4054eb05 100644
--- a/src/couchdb/couch_httpd_view.erl
+++ b/src/couchdb/couch_httpd_view.erl
@@ -364,9 +364,15 @@ parse_view_query(Req, Keys, IsReduce, IgnoreExtra) ->
{"inclusive_end", "false"} ->
Args#view_query_args{inclusive_end=false};
{"reduce", "true"} ->
- Args#view_query_args{reduce=true};
+ Args#view_query_args{
+ reduce=true,
+ req_reduce=true
+ };
{"reduce", "false"} ->
- Args#view_query_args{reduce=false};
+ Args#view_query_args{
+ reduce=false,
+ req_reduce=true
+ };
{"include_docs", Value} ->
case Value of
"true" ->
@@ -401,7 +407,18 @@ parse_view_query(Req, Keys, IsReduce, IgnoreExtra) ->
ok
end;
_ ->
- ok
+ case QueryArgs#view_query_args.req_reduce of
+ true ->
+ case QueryArgs#view_query_args.reduce of
+ true ->
+ ErrMsg = <<"Bad URL parameter: reduce=true">>,
+ throw({query_parse_error, ErrMsg});
+ _ ->
+ ok
+ end;
+ _ ->
+ ok
+ end
end,
case Keys of
nil ->