Github user rnewson commented on a diff in the pull request:
https://github.com/apache/couchdb-chttpd/pull/33#discussion_r39495330
--- Diff: src/chttpd_db.erl ---
@@ -1536,6 +1576,135 @@ set_namespace(<<"_design_docs">>, Args) ->
set_namespace(NS, #mrargs{extra = Extra} = Args) ->
Args#mrargs{extra = [{namespace, NS} | Extra]}.
+
+%% /db/_bulk_get stuff
+
+bulk_get_parse_doc_query(Req) ->
+ lists:foldl(fun({Key,Value}, Args) ->
+ case Key of
+ Key when Key =:= "open_revs"; Key =:= "new_edits"; Key =:= "w" ->
+ BKey = ?l2b(Key),
+ Msg = <<"\"", BKey/binary, "\" query parameter is not
acceptable">>,
+ throw({bad_request, Msg});
+ Key when Key =:= "rev"; Key =:= "atts_since" ->
+ BKey = ?l2b(Key),
+ Msg = <<"\"", BKey/binary, "\" query parameter should be
applied
+ on per document basis in payload">>,
+ throw({bad_request, Msg});
+ _ ->
+ parse_doc_query({Key, Value}, Args)
+ end
+ end, #doc_query_args{}, chttpd:qs(Req)).
+
+bulk_get_open_doc_revs({Props}, Db, Options) ->
+ case parse_field(<<"id">>, couch_util:get_value(<<"id">>, Props)) of
+ {error, {DocId, Error, Reason}} ->
--- End diff --
indentation is wrong (four spaces please, the unindented form from couchdb
original is deprecated)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---