Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-3222

HTTP code 500 instead of 400 for invalid key during document creation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      ...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

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          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 <mayyas@ca.ibm.com>
          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


          Show
          githubbot ASF GitHub Bot added a comment - 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 <mayyas@ca.ibm.com> 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
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 262944f0244c86c5fdb794ebe538fb916ff5415c in couchdb-chttpd's branch refs/heads/master from Mayya Sharipova
          [ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=262944f ]

          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

          Show
          jira-bot ASF subversion and git services added a comment - Commit 262944f0244c86c5fdb794ebe538fb916ff5415c in couchdb-chttpd's branch refs/heads/master from Mayya Sharipova [ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=262944f ] 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
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/couchdb-chttpd/pull/149

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-chttpd/pull/149
          Hide
          mayyas Mayya Sharipova added a comment -

          Has been merged to master

          Show
          mayyas Mayya Sharipova added a comment - Has been merged to master

            People

            • Assignee:
              Unassigned
              Reporter:
              mayyas Mayya Sharipova
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development