Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1210

files starting with underscore can be attached but not updated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1
    • 1.2, 1.2.1, 1.3
    • None
    • None
    • OSX 10.6 with CouchDB via Brew

    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

          Activity

            People

              Unassigned Unassigned
              codesturgeon Nick Fisher
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: