couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (JIRA)" <>
Subject [jira] [Created] (COUCHDB-1608) Update functions are broken if response code explicitly defined.
Date Wed, 21 Nov 2012 12:19:58 GMT
Alexander Shorin created COUCHDB-1608:

             Summary: Update functions are broken if response code explicitly defined.
                 Key: COUCHDB-1608
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
    Affects Versions: 1.3
            Reporter: Alexander Shorin
            Priority: Blocker

If update function accept document saving and has explicitly defined response code CouchDB
raises bad_match error and interrupt connection. 

Example dummy update function:
function(doc, req){
  return [{"_id": req["uuid"]}, {"code": 201, {"json": {"status": "ok"}}}]

Error in logs:
[Wed, 21 Nov 2012 12:09:55 GMT] [error] [<0.3301.0>] Uncaught error in HTTP request:

I suppose this behaviour was brought with X-Couch-ID header feature[1]. While it's HTTPish
to store documents with 201 response this not always works especially with wrong designed
"enterprise" http clients that doesn't respect anything except code 200. Also, now it's not
possible to save document and redirect somewhere.

Debug logs enabled:


This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message