couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filippo Fadda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COUCHDB-1594) Incoherent behavior when delete attachments
Date Thu, 08 Nov 2012 17:22:12 GMT
Filippo Fadda created COUCHDB-1594:
--------------------------------------

             Summary: Incoherent behavior when delete attachments
                 Key: COUCHDB-1594
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1594
             Project: CouchDB
          Issue Type: Bug
          Components: Database Core
    Affects Versions: 1.2
         Environment: Mac OS X Lion 10.7.5
            Reporter: Filippo Fadda
            Priority: Minor


There is an incoherent behavior when a client asks CouchDB to delete a resource. In fact,
when you try to delete a Database or a Document and they don't exist, you get a 404 error.
Instead, in case you delete an Attachment that doesn't exist, you'll get a 200 status code.

Here the three cases:

==============================================================================
Database deletion
==============================================================================
DELETE /adajhdgas HTTP/1.1

Accept: application/json
User-Agent: ElephantOnCouch 0.1
Connection: close
Host: 127.0.0.1:5984
Authorization: Basic cGlwcG86Y2FsaXBwbw==

HTTP/1.1 404 Object Not Found
Server: CouchDB/1.2.0 (Erlang OTP/R15B02)
Date: Thu, 08 Nov 2012 16:58:07 GMT
Content-Type: application/json
Content-Length: 41
Cache-Control: must-revalidate

{"error":"not_found","reason":"missing"}
==============================================================================


==============================================================================
Document deletion
==============================================================================
DELETE /programmazione/000569be-ecd9-446f-f681-74224e3dfc8b?rev=hhgg HTTP/1.1

Accept: application/json
User-Agent: ElephantOnCouch 0.1
Connection: close
Host: 127.0.0.1:5984
Authorization: Basic cGlwcG86Y2FsaXBwbw==

HTTP/1.1 404 Object Not Found
Server: CouchDB/1.2.0 (Erlang OTP/R15B02)
Date: Thu, 08 Nov 2012 16:55:26 GMT
Content-Type: application/json
Content-Length: 41
Cache-Control: must-revalidate

{"error":"not_found","reason":"deleted"}
==============================================================================


==============================================================================
Attachment deletion
==============================================================================
DELETE /programmazione/0003ef13-f2dd-4ccd-cbcb-dec902e7bca7/pippo%3F.txt?rev=3-54bb13543ca770a223611a1307e45dc9
HTTP/1.1

Accept: application/json
User-Agent: ElephantOnCouch 0.1
Connection: close
Host: 127.0.0.1:5984
Authorization: Basic cGlwcG86Y2FsaXBwbw==

HTTP/1.1 200 OK
Server: CouchDB/1.2.0 (Erlang OTP/R15B02)
Date: Thu, 08 Nov 2012 16:59:49 GMT
Content-Type: application/json
Content-Length: 99
Cache-Control: must-revalidate

{"ok":true,"id":"0003ef13-f2dd-4ccd-cbcb-dec902e7bca7","rev":"4-e8973f12e1ad7190d8a6b737b97b7073"}
==============================================================================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message