summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-01-07 17:33:31 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-01-07 17:33:31 +0000
commitf4d88a0164ac42b3781ebd9d170668ff95f7d9ca (patch)
treecd19f7413b5fbe7364f657306b233c765a9f01d2
parent75e24cb09c6222713224540a1d82b6539c71ac9a (diff)
apply patch to fix include docs q param parsing
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@732407 13f79535-47bb-0310-9956-ffa450edef68
-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;