[ 
https://issues.apache.org/jira/browse/COUCHDB-2375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167216#comment-14167216
 ] 

ASF GitHub Bot commented on COUCHDB-2375:
-----------------------------------------

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 <[email protected]>
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

----


> 500 error returned if rev query parameter contains -
> ----------------------------------------------------
>
>                 Key: COUCHDB-2375
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2375
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>            Reporter: Kristine Jetzke
>            Priority: Minor
>
> A 500 error is returned when putting a document with 
> {{?rev=00290d7e-0d94-4bf9-a421-33813c186513}}. The response body is  
> {code}
> {"error":"unknown_error","reason":"badarg"}
> {code}
> Expected:
> 400 with {code}{"error":"bad_request","reason":"Invalid rev format"}{code}
> Steps to reproduce:
> # {{curl -X PUT 127.0.0.1:5984/tmp}}
> # {{curl -X POST 127.0.0.1:5984/tmp -d '{}' -H 'Content-Type: 
> application/json'}}
> # {{curl -v -X PUT 
> 127.0.0.1:5984/tmp/40c8ffbe2cc32de448c77af288001063?rev=00290d7e0d944bf9a421-33813c186513
>  -d '{}' -H 'Content-Type: application/json'}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to