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

500 error returned if rev query parameter contains -

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      A 500 error is returned when putting a document with ?rev=00290d7e-0d94-4bf9-a421-33813c186513. The response body is

      {"error":"unknown_error","reason":"badarg"}
      

      Expected:
      400 with

      {"error":"bad_request","reason":"Invalid rev format"}

      Steps to reproduce:

      1. curl -X PUT 127.0.0.1:5984/tmp
      2. curl -X POST 127.0.0.1:5984/tmp -d '{}' -H 'Content-Type: application/json'
      3. curl -v -X PUT 127.0.0.1:5984/tmp/40c8ffbe2cc32de448c77af288001063?rev=00290d7e0d944bf9a421-33813c186513 -d '{}' -H 'Content-Type: application/json'

        Activity

        Hide
        kxepal Alexander Shorin added a comment -

        The problems raises in the place of decoding integer part (left side from - char) of rev.

        Show
        kxepal Alexander Shorin added a comment - The problems raises in the place of decoding integer part (left side from - char) of rev.
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user kxepal opened a pull request:

        https://github.com/apache/couchdb-couch/pull/8

        Respond with HTTP 400 Bad Request on invalid revision number

        CouchDB should return HTTP 400 instead of HTTP 500 response
        when revision number isn't integer like "foo-bar" as like as it does
        for completely invalid revisions like "foo".

        COUCHDB-2375

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/kxepal/couchdb-couch 2375-return-bad-request-on-invalid-rev-number

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/couchdb-couch/pull/8.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 #8


        commit 926791188a6d606cd720d01170ac93b6e7122d4c
        Author: Alexander Shorin <kxepal@apache.org>
        Date: 2014-10-10T18:00:03Z

        Respond with HTTP 400 Bad Request on invalid revision number

        CouchDB should return HTTP 400 instead of HTTP 500 response
        when revision number isn't integer like "foo-bar" as like as it does
        for completely invalid revisions like "foo".

        COUCHDB-2375


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user kxepal opened a pull request: https://github.com/apache/couchdb-couch/pull/8 Respond with HTTP 400 Bad Request on invalid revision number CouchDB should return HTTP 400 instead of HTTP 500 response when revision number isn't integer like "foo-bar" as like as it does for completely invalid revisions like "foo". COUCHDB-2375 You can merge this pull request into a Git repository by running: $ git pull https://github.com/kxepal/couchdb-couch 2375-return-bad-request-on-invalid-rev-number Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-couch/pull/8.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 #8 commit 926791188a6d606cd720d01170ac93b6e7122d4c Author: Alexander Shorin <kxepal@apache.org> Date: 2014-10-10T18:00:03Z Respond with HTTP 400 Bad Request on invalid revision number CouchDB should return HTTP 400 instead of HTTP 500 response when revision number isn't integer like "foo-bar" as like as it does for completely invalid revisions like "foo". COUCHDB-2375
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ed360325cacbc3f5320b28f3c42ef2bc3ca3c716 in couchdb-couch's branch refs/heads/master from Alexander Shorin
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=ed36032 ]

        Respond with HTTP 400 Bad Request on invalid revision number

        CouchDB should return HTTP 400 instead of HTTP 500 response
        when revision number isn't integer like "foo-bar" as like as it does
        for completely invalid revisions like "foo".

        COUCHDB-2375

        Show
        jira-bot ASF subversion and git services added a comment - Commit ed360325cacbc3f5320b28f3c42ef2bc3ca3c716 in couchdb-couch's branch refs/heads/master from Alexander Shorin [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=ed36032 ] Respond with HTTP 400 Bad Request on invalid revision number CouchDB should return HTTP 400 instead of HTTP 500 response when revision number isn't integer like "foo-bar" as like as it does for completely invalid revisions like "foo". COUCHDB-2375
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user kxepal closed the pull request at:

        https://github.com/apache/couchdb-couch/pull/8

        Show
        githubbot ASF GitHub Bot added a comment - Github user kxepal closed the pull request at: https://github.com/apache/couchdb-couch/pull/8
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ed360325cacbc3f5320b28f3c42ef2bc3ca3c716 in couchdb-couch's branch refs/heads/2365-fix-failed-multipart-process-leak from Alexander Shorin
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=ed36032 ]

        Respond with HTTP 400 Bad Request on invalid revision number

        CouchDB should return HTTP 400 instead of HTTP 500 response
        when revision number isn't integer like "foo-bar" as like as it does
        for completely invalid revisions like "foo".

        COUCHDB-2375

        Show
        jira-bot ASF subversion and git services added a comment - Commit ed360325cacbc3f5320b28f3c42ef2bc3ca3c716 in couchdb-couch's branch refs/heads/2365-fix-failed-multipart-process-leak from Alexander Shorin [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=ed36032 ] Respond with HTTP 400 Bad Request on invalid revision number CouchDB should return HTTP 400 instead of HTTP 500 response when revision number isn't integer like "foo-bar" as like as it does for completely invalid revisions like "foo". COUCHDB-2375
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit d65a5e8c9a8c850fa8ae784c7f6b420aaa1670eb in couchdb's branch refs/heads/1.x.x from Alexander Shorin
        [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d65a5e8 ]

        Respond with HTTP 400 Bad Request on invalid revision number

        CouchDB should return HTTP 400 instead of HTTP 500 response
        when revision number isn't integer like "foo-bar" as like as it does
        for completely invalid revisions like "foo".

        COUCHDB-2375

        Show
        jira-bot ASF subversion and git services added a comment - Commit d65a5e8c9a8c850fa8ae784c7f6b420aaa1670eb in couchdb's branch refs/heads/1.x.x from Alexander Shorin [ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d65a5e8 ] Respond with HTTP 400 Bad Request on invalid revision number CouchDB should return HTTP 400 instead of HTTP 500 response when revision number isn't integer like "foo-bar" as like as it does for completely invalid revisions like "foo". COUCHDB-2375

          People

          • Assignee:
            kxepal Alexander Shorin
            Reporter:
            tine Kristine Jetzke
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development