Skip to content

Commit 1e41311

Browse files
willholleykxepal
authored andcommitted
Set view type before validating _all_docs parameters.
Matching couch_mrview, set view_type to "map" before validating query parameters for _all_docs. This fixes a bug whereby validation fails when specifying _all_docs?conflicts=true. This closes apache#20 COUCHDB-2523 Signed-off-by: Alexander Shorin <[email protected]>
1 parent 9a8e650 commit 1e41311

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/chttpd_db.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,12 @@ db_req(#httpd{path_parts=[_, DocId | FileNameParts]}=Req, Db) ->
534534

535535
all_docs_view(Req, Db, Keys) ->
536536
Args0 = couch_mrview_http:parse_params(Req, Keys),
537-
Args1 = couch_mrview_util:validate_args(Args0),
537+
Args1 = Args0#mrargs{view_type=map},
538+
Args2 = couch_mrview_util:validate_args(Args1),
538539
ETagFun = fun(Sig, Acc0) ->
539540
couch_mrview_http:check_view_etag(Sig, Acc0, Req)
540541
end,
541-
Args = Args1#mrargs{preflight_fun=ETagFun},
542+
Args = Args2#mrargs{preflight_fun=ETagFun},
542543
Options = [{user_ctx, Req#httpd.user_ctx}],
543544
{ok, Resp} = couch_httpd:etag_maybe(Req, fun() ->
544545
VAcc0 = #vacc{db=Db, req=Req},

0 commit comments

Comments
 (0)