GitHub user nickva opened a pull request:
https://github.com/apache/couchdb-chttpd/pull/73
POST to /{db}/_all_docs with invalid keys should return 400
Now they return 500. Since there is nothing wrong on the 500,
400 is more appropriate.
For example, turns requests like these:
http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs keys:='["1",2]'
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "2",
"reason": "{illegal_docid,2}"
}
Into:
http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs keys:='["1",2]'
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "illegal_docid",
"reason": 2
}
COUCHDB-2815
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nickva/couchdb-chttpd 2815-alldocs-post-400
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-chttpd/pull/73.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #73
----
commit 31c15c70d1c1885ccf1cf6f03f18d0b079d664d9
Author: Nick Vatamaniuc <[email protected]>
Date: 2015-09-16T20:48:20Z
POST to /{db}/_all_docs with invalid keys should return 400
Now they return 500. Since there is nothing wrong on the 500,
400 is more appropriate.
For example, turns requests like these:
http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs keys:='["1",2]'
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "2",
"reason": "{illegal_docid,2}"
}
Into:
http -a adm:pass POST http://127.0.0.1:15984/db1/_all_docs keys:='["1",2]'
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "illegal_docid",
"reason": 2
}
COUCHDB-2815
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---