[
https://issues.apache.org/jira/browse/COUCHDB-3222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15636130#comment-15636130
]
ASF GitHub Bot commented on COUCHDB-3222:
-----------------------------------------
GitHub user mayya-sharipova opened a pull request:
https://github.com/apache/couchdb-chttpd/pull/149
HTTP code 500 instead of 400 for invalid key during document creation
The wrong status code is returned when creating or updating a document
with an invalid key.
Returns:
{u'reason': u'Bad special document member: _invalid_key', u'error':
u'doc_validation'}
HTTPError: 500 Server Error: Internal Server Error
Expected: 400 Bad Request error
COUCHDB-3222
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloudant/couchdb-chttpd
72658-400code-invalid-key
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-chttpd/pull/149.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 #149
----
commit 262944f0244c86c5fdb794ebe538fb916ff5415c
Author: Mayya Sharipova <[email protected]>
Date: 2016-11-03T23:46:05Z
HTTP code 500 instead of 400 for invalid key during document creation
The wrong status code is returned when creating or updating a document
with an invalid key.
Returns:
{u'reason': u'Bad special document member: _invalid_key', u'error':
u'doc_validation'}
HTTPError: 500 Server Error: Internal Server Error
Expected: 400 Bad Request error
COUCHDB-3222
----
> HTTP code 500 instead of 400 for invalid key during document creation
> ---------------------------------------------------------------------
>
> Key: COUCHDB-3222
> URL: https://issues.apache.org/jira/browse/COUCHDB-3222
> Project: CouchDB
> Issue Type: Bug
> Reporter: Mayya Sharipova
> Priority: Trivial
>
> ...dbname/doc1" -d '{"_id":"doc1", "_invalid_key":"jules" }'
> Returns:
> {u'reason': u'Bad special document member: _invalid_key', u'error':
> u'doc_validation'}
> HTTPError: 500 Server Error: Internal Server Error
> Expected: 400 Bad Request error
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)