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

    https://github.com/apache/couchdb-chttpd/pull/33#discussion_r39495209
  
    --- Diff: src/chttpd_db.erl ---
    @@ -449,6 +449,45 @@ 
db_req(#httpd{method='POST',path_parts=[_,<<"_bulk_docs">>], user_ctx=Ctx}=Req,
     db_req(#httpd{path_parts=[_,<<"_bulk_docs">>]}=Req, _Db) ->
         send_method_not_allowed(Req, "POST");
     
    +
    +db_req(#httpd{method='POST',
    +              path_parts=[_, <<"_bulk_get">>],
    +              mochi_req=MochiReq}=Req,
    +       Db) ->
    +    couch_stats:increment_counter([couchdb, httpd, bulk_requests]),
    +    couch_httpd:validate_ctype(Req, "application/json"),
    +    {JsonProps} = chttpd:json_body_obj(Req),
    +    case couch_util:get_value(<<"docs">>, JsonProps) of
    +    undefined ->
    +        throw({bad_request, <<"Missing JSON list of 'docs'.">>});
    +    Docs ->
    +        #doc_query_args{
    +            options = Options
    +        } = bulk_get_parse_doc_query(Req),
    +
    +        AcceptMixedMp = MochiReq:accepts_content_type("multipart/mixed"),
    +        AcceptRelatedMp = 
MochiReq:accepts_content_type("multipart/related"),
    +
    +        case AcceptMixedMp orelse AcceptRelatedMp of
    +        true ->
    +            throw({not_acceptable,
    --- End diff --
    
    why do this? If application/json is acceptable (which we don't even test 
for here), we can send the response, it doesn't matter if the request would 
accept other types.


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