Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
CouchDB from HEAD
-
New Contributors Level (Easy)
Description
When using an _update handler, it should be possible to return a response code.
return [ doc, {
headers :
,
code : 303,
body : 'Redirecting'
}];
Should return 303 (the redirect for POST) but in fact, on a successful create returns 201. This means it is not possible to use the browser to POST as you cannot redirect on return. This feels like a bug.
In any case, I would respectfully suggest that the syntax of the _update handler be changed so that there is a store(doc) call (or similar) which returns a JSON object to the update handler so that the handler may redirect appropriately. That would make it possible to do updates client-side with little or no client-side javascript.
Attachments
Attachments
Issue Links
- is duplicated by
-
COUCHDB-990 Update handlers ignore HTTP status codes in responses
- Closed