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_r232475939
##########
File path: src/chttpd/src/chttpd_db.erl
##########
@@ -997,6 +1075,23 @@ send_docs_multipart(Req, Results, Options1) ->
couch_httpd:send_chunk(Resp, <<"--">>),
couch_httpd:last_chunk(Resp).
+bulk_get_multipart_headers({0, []}, Id, Boundary) ->
+ [
+ <<"\r\nX-Doc-Id: ", Id/binary>>,
+ <<"\r\nContent-Type: multipart/related; boundary=", Boundary/binary,
"\r\n\r\n">>
+ ];
+bulk_get_multipart_headers({Start, [FirstRevId|_]}, Id, Boundary) ->
+ RevStr = couch_doc:rev_to_str({Start, FirstRevId}),
+ [
+ <<"\r\nX-Doc-Id: ", Id/binary>>,
+ <<"\r\nX-Rev-Id: ", RevStr/binary>>,
+ <<"\r\nContent-Type: multipart/related; boundary=", Boundary/binary,
"\r\n\r\n">>
+ ].
+
+bulk_get_multipart_boundary() ->
+ Unique = couch_uuids:random(),
+ <<"---------------------------", Unique/binary>>.
Review comment:
Another question. Why does it have to be `<<"---------------------------"`
and not `<<"--"`? Was it for testing mainly or another reason?
----------------------------------------------------------------
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