From 8fbe7fa7b6ad515c456e21ba41d55dccd52ac3c6 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Tue, 27 Oct 2009 04:40:18 +0000 Subject: Fixed a minor bug with attachments of zero length. The Erlang PID handling the request would crash after headers were sent so that the browser never noticed but my cURL client did. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@830056 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_db.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_httpd_db.erl') diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index bd83cd87..4fea824b 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -876,8 +876,11 @@ db_attachment_req(#httpd{method='GET'}=Req, Db, DocId, FileNameParts) -> {"Cache-Control", "must-revalidate"}, {"Content-Type", binary_to_list(Type)} ], integer_to_list(Len)), - couch_doc:att_foldl(Att, - fun(BinSegment, _) -> send(Resp, BinSegment) end,[]) + couch_doc:att_foldl( + Att, + fun(BinSegment, _) -> send(Resp, BinSegment) end, + {ok, Resp} % Seed in case of 0 byte attachment. + ) end) end; -- cgit v1.2.3