You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/27 11:14:32 UTC

[GitHub] [couchdb-nano] glynnbird commented on issue #195: db.attachment.get function corrupts attachment

glynnbird commented on issue #195: db.attachment.get function corrupts attachment
URL: https://github.com/apache/couchdb-nano/issues/195#issuecomment-591916634
 
 
   Steps to reproduce:
   
   ```js
   const Nano = require('nano')
   const fs = require('fs')
   
   const main = async () => {
     const nano = Nano(process.env.COUCH_URL)
     const db = nano.db.use('a')
     const att = await db.attachment.get('b','dog.jpg')
     fs.writeFileSync('dog.jpg', att)  
   }
   
   main()
   ```
   
   with a document like this: 
   
   ```js
   {
     "_id": "b",
     "_rev": "3-c0a1ce76712f8f1c3eb3d296c0cf4e29",
     "x": 1,
     "y": 2,
     "_attachments": {
       "dog.jpg": {
         "content_type": "image/jpeg",
         "revpos": 2,
         "digest": "md5-2Vq3z0rHeNN+DkJk1BVgCg==",
         "length": 93651,
         "stub": true
       }
     }
   }
   ```
   
   Confirmed that it fails on nano8.1 but passes on Nano master.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services