summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2010-08-17 20:38:59 +0000
committerRobert Newson <rnewson@apache.org>2010-08-17 20:38:59 +0000
commit086eec7b899f566d72fcf0b3effc070e591ee37e (patch)
tree8cf372173c21837befad571af9811be9d522d24d
parent6742e81cdac5351d80d34f1aa7af7610408c756a (diff)
fix badmatch when fetching zero byte attachments.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986476 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/couchdb/couch_httpd_db.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 54b01600..3c7e57c4 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -922,11 +922,11 @@ db_attachment_req(#httpd{method='GET'}=Req, Db, DocId, FileNameParts) ->
case Len of
undefined ->
{ok, Resp} = start_chunked_response(Req, 200, Headers),
- AttFun(Att, fun(Seg, _) -> send_chunk(Resp, Seg) end, ok),
+ AttFun(Att, fun(Seg, _) -> send_chunk(Resp, Seg) end, {ok, Resp}),
last_chunk(Resp);
_ ->
{ok, Resp} = start_response_length(Req, 200, Headers, Len),
- AttFun(Att, fun(Seg, _) -> send(Resp, Seg) end, ok)
+ AttFun(Att, fun(Seg, _) -> send(Resp, Seg) end, {ok, Resp})
end
end
)