couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1125830 - in /couchdb/branches/1.1.x: share/www/script/test/attachments_multipart.js src/couchdb/couch_httpd_db.erl
Date Sat, 21 May 2011 22:01:39 GMT
Author: fdmanana
Date: Sat May 21 22:01:38 2011
New Revision: 1125830

URL: http://svn.apache.org/viewvc?rev=1125830&view=rev
Log:
Merged revision 1125828 from trunk

    Add missing option to multipart/related GETs

    This is necessary as the client needs to be able to know if
    attachments are encoded or not.


Modified:
    couchdb/branches/1.1.x/share/www/script/test/attachments_multipart.js
    couchdb/branches/1.1.x/src/couchdb/couch_httpd_db.erl

Modified: couchdb/branches/1.1.x/share/www/script/test/attachments_multipart.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/share/www/script/test/attachments_multipart.js?rev=1125830&r1=1125829&r2=1125830&view=diff
==============================================================================
--- couchdb/branches/1.1.x/share/www/script/test/attachments_multipart.js (original)
+++ couchdb/branches/1.1.x/share/www/script/test/attachments_multipart.js Sat May 21 22:01:38
2011
@@ -39,7 +39,7 @@ couchTests.attachments_multipart= functi
             },
           "baz.txt": {
             "follows":true,
-            "content_type":"application/test",
+            "content_type":"text/plain",
             "length":19
             }
           }
@@ -78,12 +78,15 @@ couchTests.attachments_multipart= functi
   
   // now edit an attachment
   
-  var doc = db.open("multipart");
+  var doc = db.open("multipart", {att_encoding_info: true});
   var firstrev = doc._rev;
   
   T(doc._attachments["foo.txt"].stub == true);
   T(doc._attachments["bar.txt"].stub == true);
   T(doc._attachments["baz.txt"].stub == true);
+  TEquals("undefined", typeof doc._attachments["foo.txt"].encoding);
+  TEquals("undefined", typeof doc._attachments["bar.txt"].encoding);
+  TEquals("gzip", doc._attachments["baz.txt"].encoding);
   
   //lets change attachment bar
   delete doc._attachments["bar.txt"].stub; // remove stub member (or could set to false)

Modified: couchdb/branches/1.1.x/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_httpd_db.erl?rev=1125830&r1=1125829&r2=1125830&view=diff
==============================================================================
--- couchdb/branches/1.1.x/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/branches/1.1.x/src/couchdb/couch_httpd_db.erl Sat May 21 22:01:38 2011
@@ -762,7 +762,7 @@ send_doc_efficiently(#httpd{mochi_req = 
         true ->
             Boundary = couch_uuids:random(),
             JsonBytes = ?JSON_ENCODE(couch_doc:to_json_obj(Doc, 
-                    [attachments, follows|Options])),
+                    [attachments, follows, att_encoding_info | Options])),
             {ContentType, Len} = couch_doc:len_doc_to_multi_part_stream(
                     Boundary,JsonBytes, Atts, true),
             CType = {<<"Content-Type">>, ContentType},



Mime
View raw message