summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-10-27 04:40:18 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-10-27 04:40:18 +0000
commit8fbe7fa7b6ad515c456e21ba41d55dccd52ac3c6 (patch)
tree3c53e3862090697ad89af2f2902a76e4c52a11c1
parentd6ca78c9c09e88e84b303ebcb5d355e148ebcc7d (diff)
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
-rw-r--r--src/couchdb/couch_httpd_db.erl7
1 files changed, 5 insertions, 2 deletions
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;