Details
Description
Files that have a name starting with a leading underscore (EG '_foo.txt') can be attached to a document when it is created, but not when it it updated. I assume that the create that allows the underscore is in error from what I read here:
https://github.com/apache/couchdb/blob/trunk/share/www/script/test/attachment_names.js#L77
Example:
$ curl -X POST http://localhost:5984/testdb -H "Content-Type: application/json" -d '{ "_id": "testing_doc", "_attachments": { "_id":
{ "data": "X2Rlc2lnbi9jb25hbgo=", "content_type": "application/octet-stream" }} }'
{"ok":true,"id":"testing_doc","rev":"1-86408f7d442563ec03ffb57c0226ccec"}$ curl -X PUT http://localhost:5984/conan/testing_doc -H "Content-Type: application/json" -d '{ "_id": "testing_doc", "rev":"1-86408f7d442563ec03ffb57c0226ccec", "_attachments": { "_id":
{ "data": "X2Rlc2lnbi9jb25hbgo=", "content_type": "application/octet-stream" }} }'
{"error":"bad_request","reason":"Attachment name can't start with '_'"}Attachments
Issue Links
- is duplicated by
-
COUCHDB-818 _bulk_docs throws "Attachment name can't start with '_'" but document POST API does not
- Closed