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

DELETE attachment on non-existing document creates the document, rather than returning 404

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0, 1.6.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      Create an emtpy database:
      curl -v -X PUT http://admin:abc123@localhost:6001/new

      Then try to delete an attachment from a (non-existant) document:
      curl -v -X DELETE http://admin:abc123@localhost:6001/new/foo/foo.txt

      The result is that the document "foo" is created:

      {"ok":true,"id":"foo","rev":"1-967a00dff5e02add41819138abb3284d"}

      Expected:

      404 error, as per the docs: http://docs.couchdb.org/en/2.0.0/api/document/attachments.html#delete--db-docid-attname

      Observed in both CouchDB 1.6.1 and 2.0.0

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              flimzy Jonathan Hall
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: