noahshaw11 opened a new pull request #3673:
URL: https://github.com/apache/couchdb/pull/3673
## Overview
Currently, a DELETE request for a non existent attachment responds with a
200 OK even if the attachment is missing. This PR changes the response code for
nonexistent attachments to a 404 NOT FOUND
`{"error":"not_found","reason":"Document is missing attachment"}`
## Testing recommendations
```
% curl -X PUT http://localhost:15984/demo/38 -H 'Authorization: Basic
YWRtOnBhc3M=' -d '{"name": "whatever"}'
{"ok":true,"id":"38","rev":"1-a0f595984a7c4cf1dafc4cf4c04081d6"}
% curl -X DELETE
'http://adm:pass@localhost:15984/demo/38/notexisting.txt?rev=1-a0f595984a7c4cf1dafc4cf4c04081d6'
{"error":"not_found","reason":"Document is missing attachment"}
```
## Related Issues or Pull Requests
Deleting not existing attachment responds 200 instead of 404:
https://github.com/apache/couchdb/issues/2146
## Checklist
- [x] Code is written and works correctly
- [x] Changes are covered by tests
- [x] Any new configurable parameters are documented in
`rel/overlay/etc/default.ini`
- [ ] A PR for documentation changes has been made in
https://github.com/apache/couchdb-documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]