[ 
https://issues.apache.org/jira/browse/COUCHDB-2252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15245414#comment-15245414
 ] 

Johannes J. Schmidt commented on COUCHDB-2252:
----------------------------------------------

This seems to be not a problem in 1.6.1 anymore, as shown with this curl 
session:

{code}
$ curl http://localhost:5984
{"couchdb":"Welcome","uuid":"f92d783dc25255c843f4a68942ab1a16","version":"1.6.1","vendor":{"name":"The
 Apache Software Foundation","version":"1.6.1"}}
$ curl http://localhost:5984/_config/couchdb/file_compression
"snappy"
$ curl http://localhost:5984/_config/attachments/compressible_types
"text/*, application/javascript, application/json, application/xml"

$ curl -XPUT http://localhost:5984/test-2252
{"ok":true}

$ curl -XPUT http://localhost:5984/test-2252/snappy/data.json [email protected] 
-H'Content-Type:application/json'
{"ok":true,"id":"snappy","rev":"1-21b4756f366eb6c17a161b44960911c2"}

$ curl -XPUT http://localhost:5984/_config/couchdb/file_compression -d'"none"'
"snappy"

$ curl -XPUT http://localhost:5984/test-2252/none/data.json [email protected] 
-H'Content-Type:application/json'
{"ok":true,"id":"none","rev":"1-21b4756f366eb6c17a161b44960911c2"}

$ curl http://localhost:5984/test-2252/snappy
{"_id":"snappy","_rev":"1-21b4756f366eb6c17a161b44960911c2","_attachments":{"data.json":{"content_type":"application/json","revpos":1,"digest":"md5-tZARHgBFd0PpmG0sebe1fg==","length":216259,"stub":true}}}
$ curl http://localhost:5984/test-2252/none
{"_id":"none","_rev":"1-21b4756f366eb6c17a161b44960911c2","_attachments":{"data.json":{"content_type":"application/json","revpos":1,"digest":"md5-tZARHgBFd0PpmG0sebe1fg==","length":216259,"stub":true}}}
{code}

Here we created two documents with the same attachment. For the second one we 
changed compression from {{snappy}} to {{none}} before we created it. Than we 
can compare the {{digest}} of both attachments. They are the same.

> Digest for attachments is calculated from compressed data. 
> -----------------------------------------------------------
>
>                 Key: COUCHDB-2252
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2252
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>            Reporter: Alexander Fedorenchik
>
> Actual behaviour:
> CouchDB returns digest calculated from compressed data for attachments with 
> MIME types listed in config. 
> http://docs.couchdb.org/en/latest/config/misc.html#attachments
> Expected behaviour:
> CouchDB should return digest calculated from raw data to be able to compare 
> it with local one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to