iilyak commented on a change in pull request #1082: Provide info=true and
keys=[] arguments for /_all_dbs
URL: https://github.com/apache/couchdb/pull/1082#discussion_r161301801
##########
File path: src/chttpd/src/chttpd_misc.erl
##########
@@ -103,6 +103,52 @@ maybe_add_csp_headers(Headers, _) ->
Headers.
handle_all_dbs_req(#httpd{method='GET'}=Req) ->
+ Params = lists:flatmap(fun({K, V}) -> parse_all_dbs_param(K, V) end,
+ chttpd:qs(Req)),
+ Args = lists:foldl(fun({K, V}, Arg) -> validate_alldbs_query(K, V, Arg)
+ end, #alldbs_query_args{}, Params),
+ maybe_handle_all_dbs_info(Req, Args#alldbs_query_args.info,
+ Args#alldbs_query_args.keys);
+handle_all_dbs_req(Req) ->
+ send_method_not_allowed(Req, "GET,HEAD").
+
+maybe_handle_all_dbs_info(Req, true, []) ->
+ Params = couch_mrview_http:parse_params(Req, undefined),
+ ShardDbName = config:get("mem3", "shards_db", "_dbs"),
+ Options = [{user_ctx, Req#httpd.user_ctx}],
+ Callback = fun({meta, _}, []) ->
Review comment:
weird indentation. I would write it as:
```
Callback = fun
({meta, _}, []) ->
{ok, []};
({row, Props}, Acc) ->
something
end,
```
If you prefer to keep your style please add 4 more spaces before `{ok, []};`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services