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

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 5713b30e0e1e3d86cd41a3adbcf878b7ed214873 in couchdb's branch refs/heads/master from Peng Hui Jiang
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=5713b30 ]

        Avoid creation of document if deleting attachment on non-existent doc

        • Check existence of document before deleting its attachment
        • if document doesn’t exist, return 404 instead of creating new
          document

        Fixes COUCHDB-3362/FB 85549

        Show
        jira-bot ASF subversion and git services added a comment - Commit 5713b30e0e1e3d86cd41a3adbcf878b7ed214873 in couchdb's branch refs/heads/master from Peng Hui Jiang [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=5713b30 ] Avoid creation of document if deleting attachment on non-existent doc Check existence of document before deleting its attachment if document doesn’t exist, return 404 instead of creating new document Fixes COUCHDB-3362 /FB 85549

          People

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

            Dates

            • Created:
              Updated:

              Development