From f4d88a0164ac42b3781ebd9d170668ff95f7d9ca Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Wed, 7 Jan 2009 17:33:31 +0000 Subject: 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 --- src/couchdb/couch_httpd_view.erl | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/couchdb') 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; -- cgit v1.2.3