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_r161304126
 
 

 ##########
 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, []) ->
 
 Review comment:
   I don't think we should allow getting info about all databases. It is too 
expensive and it is a perfect way to make a couch_server unresponsive due to 
message queue size. 

----------------------------------------------------------------
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

Reply via email to