summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--THANKS1
-rw-r--r--src/couchdb/couch_httpd_view.erl25
2 files changed, 13 insertions, 13 deletions
diff --git a/THANKS b/THANKS
index 532bc107..c00a60a4 100644
--- a/THANKS
+++ b/THANKS
@@ -19,6 +19,7 @@ Some of these people are:
* Adam Kocoloski <adam.kocoloski@gmail.com>
* Roger Leigh <rleigh@debian.org>
* Jim Lindley <web@jimlindley.com>
+ * Hunter Morris <huntermorris@gmail.com>
* Sam Ruby <rubys@intertwingly.net>
* Dirk Schalge <dirk@epd-me.net>
* Carlos Valiente <superdupont@gmail.com>
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;