Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Port workaround for COUCHDB-902

BugzID: 11366
  • Loading branch information...
commit c484b5bb928c07f09e351a1dc0997d7b01182aa0 1 parent 07fd88e
@kocolosk kocolosk authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/chttpd_db.erl
View
4 src/chttpd_db.erl
@@ -892,8 +892,10 @@ db_attachment_req(#httpd{method=Method, user_ctx=Ctx}=Req, Db, DocId, FileNamePa
end
end,
- #doc{atts=Atts} = Doc,
+ #doc{atts=Atts, revs = {Pos, Revs}} = Doc,
DocEdited = Doc#doc{
+ % prune revision list as a workaround for key tree bug (COUCHDB-902)
+ revs = {Pos, case Revs of [] -> []; [Hd|_] -> [Hd] end},
atts = NewAtt ++ [A || A <- Atts, A#att.name /= FileName]
},
{ok, UpdatedRev} = fabric:update_doc(Db, DocEdited, [{user_ctx,Ctx}]),
Please sign in to comment.
Something went wrong with that request. Please try again.