Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E54764FCE for ; Fri, 1 Jul 2011 05:16:09 +0000 (UTC) Received: (qmail 12988 invoked by uid 500); 1 Jul 2011 05:16:08 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 12217 invoked by uid 500); 1 Jul 2011 05:16:04 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 11430 invoked by uid 99); 1 Jul 2011 05:15:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2011 05:15:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2011 05:15:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CCB7843DF19 for ; Fri, 1 Jul 2011 05:15:29 +0000 (UTC) Date: Fri, 1 Jul 2011 05:15:29 +0000 (UTC) From: "Christian Carter (JIRA)" To: dev@couchdb.apache.org Message-ID: <576725645.7839.1309497329834.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (COUCHDB-648) _update handler ignores "code" in response doc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Carter updated COUCHDB-648: ------------------------------------- Attachment: test.diff Test > _update handler ignores "code" in response doc > ---------------------------------------------- > > Key: COUCHDB-648 > URL: https://issues.apache.org/jira/browse/COUCHDB-648 > Project: CouchDB > Issue Type: Bug > Components: Database Core > Environment: CouchDB from HEAD > Reporter: Cliff Stanford > Labels: update > Attachments: 0001-Document-update-handlers-now-honor-code-in-response-.patch, test.diff > > > When using an _update handler, it should be possible to return a response code. > return [ doc, { > headers : { "Location" : "/" }, > 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. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira