nickva commented on a change in pull request #1195: Add support for bulk get
with Accept:"multipart/mixed" or "multipart/related"
URL: https://github.com/apache/couchdb/pull/1195#discussion_r232005992
##########
File path: src/chttpd/src/chttpd_db.erl
##########
@@ -952,21 +1025,34 @@ send_docs_multipart(Req, Results, Options1) ->
couch_doc:doc_to_multi_part_stream(InnerBoundary, JsonBytes, Atts,
fun(Data) -> couch_httpd:send_chunk(Resp, Data)
end, true),
- couch_httpd:send_chunk(Resp, <<"\r\n--", OuterBoundary/binary>>)
+ couch_httpd:send_chunk(Resp, <<"\r\n--", OuterBoundary/binary>>)
after
demonitor_refs(Refs)
end;
({{not_found, missing}, RevId}) ->
- RevStr = couch_doc:rev_to_str(RevId),
- Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}),
- couch_httpd:send_chunk(Resp,
+ RevStr = couch_doc:rev_to_str(RevId),
+ Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}),
+ couch_httpd:send_chunk(Resp,
[<<"\r\nContent-Type: application/json;
error=\"true\"\r\n\r\n">>,
Json,
<<"\r\n--", OuterBoundary/binary>>])
end, Results),
couch_httpd:send_chunk(Resp, <<"--">>),
couch_httpd:last_chunk(Resp).
+bulk_get_multipart_headers({0, []}, Id, Boundary) ->
+ [<<"\r\nX-Doc-Id: ", Id/binary>>,
Review comment:
Maybe a bit pedantic but let's keep `[` on its own line and `<<...>>>` on
separate lines indented by 4 spaces. Then final `]` matching with the original
`[`. Like so:
```
[
<<"\r\n...."/binary>>,
<<....>>>
];
```
----------------------------------------------------------------
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