rnewson commented on code in PR #4494:
URL: https://github.com/apache/couchdb/pull/4494#discussion_r1157031693


##########
src/couch_mrview/src/couch_mrview_http.erl:
##########
@@ -513,8 +518,22 @@ parse_body_and_query(Req, Keys) ->
 
 parse_body_and_query(Req, {Props}, Keys) ->
     Args = #mrargs{keys = Keys, group = undefined, group_level = undefined},
-    BodyArgs = parse_params(Props, Keys, Args, [decoded]),
-    parse_params(chttpd:qs(Req), Keys, BodyArgs, [keep_group_level]).
+    BodyArgs0 = parse_params(Props, Keys, Args, [decoded]),
+    BodyArgs1 =
+        case is_view(Req) of
+            true -> treat_single_keys_as_key(BodyArgs0);
+            false -> BodyArgs0
+        end,
+    parse_params(chttpd:qs(Req), Keys, BodyArgs1, [keep_group_level]).
+
+is_view(#httpd{path_parts = Path}) ->

Review Comment:
   right, in those cases we'll hit the second clause. we could be more 
proscriptive with `[_, _, _, <<"_view">>, _]` but I think it's fine to leave 
the right side variable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to