diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-01-07 17:33:31 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-01-07 17:33:31 +0000 |
commit | f4d88a0164ac42b3781ebd9d170668ff95f7d9ca (patch) | |
tree | cd19f7413b5fbe7364f657306b233c765a9f01d2 /src/couchdb | |
parent | 75e24cb09c6222713224540a1d82b6539c71ac9a (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
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_httpd_view.erl | 25 |
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; |