couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <>
Subject [jira] [Resolved] (COUCHDB-1488) Allow Validation Functions to Modify Response
Date Thu, 31 May 2012 16:04:23 GMT


Robert Newson resolved COUCHDB-1488.

       Resolution: Won't Fix
    Fix Version/s:     (was: 1.3)

Sorry, not happening. This would mess with replication.
> Allow Validation Functions to Modify Response
> ---------------------------------------------
>                 Key: COUCHDB-1488
>                 URL:
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>    Affects Versions: 1.2
>            Reporter: Dominic Barnes
>              Labels: api-change
> I would like some way for a validation function to modify the response headers, in my
case to issue a redirect to a browser.
> My use-case is that I'm trying to build a CouchApp, but I'm not just creating a single-page
JS application. I'm using shows/lists/attachments/etc to have the application operate without
the client-side JS requirement.
> I'm thinking this can be accomplished by simply appending fields to the thrown error
object that would coincide with the response object anywhere else. In addition, since the
validation function runs after an update-handler, this would override anything being set there.
(which makes the most sense)
> For example:
> if (!newDoc.title) {
>    throw {
>       code: 303,
>       headers: {
>          location: "/form?message=Title Required"
>       }
>    };
> }

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


View raw message