summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-07 14:47:37 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-07 14:47:37 +0000
commitbd126404ee12f7e17c2d8b88cb3bb248bcea7aaa (patch)
tree9908f3edfb31c837e69d83a1b94a40b307a28d66 /src
parentc4542b989a27f7883316a94fc75aaf8a69529732 (diff)
Allow the atts_since parameter to work together with the open_revs parameter.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032288 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd_db.erl17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 51f1f55a..34e38f77 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -583,18 +583,19 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) ->
#doc_query_args{
rev = Rev,
open_revs = Revs,
- options = Options,
+ options = Options1,
atts_since = AttsSince
} = parse_doc_query(Req),
+ Options = case AttsSince of
+ nil ->
+ Options1;
+ RevList when is_list(RevList) ->
+ [{atts_since, RevList}, attachments | Options1]
+ end,
case Revs of
[] ->
- Options2 =
- if AttsSince /= nil ->
- [{atts_since, AttsSince}, attachments | Options];
- true -> Options
- end,
- Doc = couch_doc_open(Db, DocId, Rev, Options2),
- send_doc(Req, Doc, Options2);
+ Doc = couch_doc_open(Db, DocId, Rev, Options),
+ send_doc(Req, Doc, Options);
_ ->
{ok, Results} = couch_db:open_doc_revs(Db, DocId, Revs, Options),
AcceptedTypes = case couch_httpd:header_value(Req, "Accept") of