From bd126404ee12f7e17c2d8b88cb3bb248bcea7aaa Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Sun, 7 Nov 2010 14:47:37 +0000 Subject: 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 --- share/www/script/test/attachments_multipart.js | 42 +++++++++++++++++++++++--- src/couchdb/couch_httpd_db.erl | 17 ++++++----- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/share/www/script/test/attachments_multipart.js b/share/www/script/test/attachments_multipart.js index 72cca971..ce35e653 100644 --- a/share/www/script/test/attachments_multipart.js +++ b/share/www/script/test/attachments_multipart.js @@ -115,8 +115,11 @@ couchTests.attachments_multipart= function(debug) { // now test receiving multipart docs function getBoundary(xhr) { - var ctype = xhr.getResponseHeader("Content-Type"); - + if (xhr instanceof XMLHttpRequest) { + var ctype = xhr.getResponseHeader("Content-Type"); + } else { + var ctype = xhr.headers['Content-Type']; + } var ctypeArgs = ctype.split("; ").slice(1); var boundary = null; for(var i=0; i #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 -- cgit v1.2.3