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.erl25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl
index 80e06908..79f275c9 100644
--- a/src/couchdb/couch_httpd_view.erl
+++ b/src/couchdb/couch_httpd_view.erl
@@ -306,19 +306,6 @@ parse_view_query(Req, Keys, IsReduce) ->
{"reduce", "false"} ->
Args#view_query_args{reduce=false};
{"include_docs", Value} ->
- case IsReduce of
- true ->
- #view_query_args{reduce=OptReduce} = Args,
- case OptReduce of
- true ->
- Msg = lists:flatten(io_lib:format("Bad URL query key for reduce operation: ~s", [Key])),
- throw({query_parse_error, Msg});
- _ ->
- ok
- end;
- _ ->
- ok
- end,
case Value of
"true" ->
Args#view_query_args{include_docs=true};
@@ -334,6 +321,18 @@ parse_view_query(Req, Keys, IsReduce) ->
throw({query_parse_error, Msg})
end
end, #view_query_args{}, QueryList),
+ case IsReduce of
+ true ->
+ case QueryArgs#view_query_args.include_docs and QueryArgs#view_query_args.reduce of
+ true ->
+ ErrMsg = "Bad URL query key for reduce operation: include_docs",
+ throw({query_parse_error, ErrMsg});
+ _ ->
+ ok
+ end;
+ _ ->
+ ok
+ end,
case Keys of
nil ->
QueryArgs;