Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-chttpd/pull/33#discussion_r39497299
  
    --- 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" ->
    --- End diff --
    
    Like this:
    ```
    bulk_get_parse_doc_query(Req) ->
        lists:foldl(fun({Key,Value}, Args) ->
            case Key of
                "open_revs"  -> bad_query_param(not_acceptable, Key);
                "new_edits"  -> bad_query_param(not_acceptable, Key);
                "w"          -> bad_query_param(not_acceptable, Key);
                "rev"        -> bad_query_param(should_be_inlined, Key);
                "atts_since" -> bad_query_param(should_be_inlined, Key);
                _            -> parse_doc_query({Key, Value}, Args)
            end
        end, #doc_query_args{}, chttpd:qs(Req)).
    
    bad_query_param(Error, Key) when is_list(Key) ->
        bad_query_param(Error, ?l2b(Key));
    bad_query_param(not_acceptable, Key) ->
        Msg = <<"\"", Key/binary, "\" query parameter is not acceptable">>,
        throw({bad_request, Msg});
    bad_query_param(should_be_inlined, Key) ->
        Msg = <<"\"", Key/binary, "\" query parameter should be applied
                 on per document basis in payload">>,
        throw({bad_request, Msg}).
    ```
    ?


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

Reply via email to