[ https://issues.apache.org/jira/browse/COUCHDB-2251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexander Fedorenchik updated COUCHDB-2251:
-------------------------------------------
Description:
Steps to reproduce:
1) Create 2 files with the same json content. Give one .json extension and .bin to another.
2) Upload both of them as attachments to any document.
Expected result:
Digest for both files have to be equal.
Actual result:
Digests are different. ".bin" file have correct one.
Example:
Json:
{"list":[12,23,34,45,56,67,78,89],"map":{"q1":"q2","q3":4}}
Local calculation:
$ openssl dgst -md5 -binary data.json | openssl enc -base64
QDCakqgzxC+eQ2cWTtsYag==
$ openssl dgst -md5 -binary data.bin | openssl enc -base64
QDCakqgzxC+eQ2cWTtsYag==
CouchDB reply for files uploaded with command line:
"_attachments": {
"data.bin": {
"content_type": "application/octet-stream",
"revpos": 8,
"digest": "md5-QDCakqgzxC+eQ2cWTtsYag==",
"length": 60,
"stub": true
},
"data.json": {
"content_type": "application/json",
"revpos": 8,
"digest": "md5-WGgcu4jx7uT83fJQUC+XsA==",
"length": 60,
"stub": true
}
}
CouchDB reply for files uploaded with Futon:
"_attachments": {
"data.bin": {
"content_type": "application/macbinary",
"revpos": 3,
"digest": "md5-QDCakqgzxC+eQ2cWTtsYag==",
"length": 60,
"stub": true
},
"data.json": {
"content_type": "application/json",
"revpos": 2,
"digest": "md5-WGgcu4jx7uT83fJQUC+XsA==",
"length": 60,
"stub": true
}
}
was:
Steps to reproduce:
1) Create 2 files with the same json content. Give one .json extension and .bin to another.
2) Upload both of them as attachments to any document.
Expected result:
Digest for both files have to be equal.
Actual result:
Digests are different. ".bin" file have correct one.
> Digest for attachments depends on "content_type"
> ------------------------------------------------
>
> Key: COUCHDB-2251
> URL: https://issues.apache.org/jira/browse/COUCHDB-2251
> Project: CouchDB
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: Database Core
> Affects Versions: 1.5.1
> Environment: Mac OS X 10.9
> Reporter: Alexander Fedorenchik
>
> Steps to reproduce:
> 1) Create 2 files with the same json content. Give one .json extension and .bin to another.
> 2) Upload both of them as attachments to any document.
> Expected result:
> Digest for both files have to be equal.
> Actual result:
> Digests are different. ".bin" file have correct one.
> Example:
> Json:
> {"list":[12,23,34,45,56,67,78,89],"map":{"q1":"q2","q3":4}}
> Local calculation:
> $ openssl dgst -md5 -binary data.json | openssl enc -base64
> QDCakqgzxC+eQ2cWTtsYag==
> $ openssl dgst -md5 -binary data.bin | openssl enc -base64
> QDCakqgzxC+eQ2cWTtsYag==
> CouchDB reply for files uploaded with command line:
> "_attachments": {
> "data.bin": {
> "content_type": "application/octet-stream",
> "revpos": 8,
> "digest": "md5-QDCakqgzxC+eQ2cWTtsYag==",
> "length": 60,
> "stub": true
> },
> "data.json": {
> "content_type": "application/json",
> "revpos": 8,
> "digest": "md5-WGgcu4jx7uT83fJQUC+XsA==",
> "length": 60,
> "stub": true
> }
> }
> CouchDB reply for files uploaded with Futon:
> "_attachments": {
> "data.bin": {
> "content_type": "application/macbinary",
> "revpos": 3,
> "digest": "md5-QDCakqgzxC+eQ2cWTtsYag==",
> "length": 60,
> "stub": true
> },
> "data.json": {
> "content_type": "application/json",
> "revpos": 2,
> "digest": "md5-WGgcu4jx7uT83fJQUC+XsA==",
> "length": 60,
> "stub": true
> }
> }
--
This message was sent by Atlassian JIRA
(v6.2#6252)
|