Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 23165 invoked from network); 18 Sep 2010 22:25:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Sep 2010 22:25:06 -0000 Received: (qmail 70837 invoked by uid 500); 18 Sep 2010 22:25:06 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 70742 invoked by uid 500); 18 Sep 2010 22:25:05 -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 70729 invoked by uid 99); 18 Sep 2010 22:25:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Sep 2010 22:25:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Sep 2010 22:25:04 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8IMOiqB005681 for ; Sat, 18 Sep 2010 22:24:44 GMT Message-ID: <24551215.278021284848684050.JavaMail.jira@thor> Date: Sat, 18 Sep 2010 18:24:44 -0400 (EDT) From: "Felix Henninger (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-648) _update handler ignores "code" in response doc In-Reply-To: <1742769930.162101265752228334.JavaMail.jira@brutus.apache.org> 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:comment-tabpanel&focusedCommentId=12911111#action_12911111 ] Felix Henninger commented on COUCHDB-648: ----------------------------------------- I would like to add that this issue persists when the start() method is used (c.f. http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Sending_a_Redirect ). As rnewson commented on IRC, the response code is hardcoded for _updates (couch_httpd_show:send_doc_update_response; http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_show.erl?view=markup#L125), but not for _lists and _shows -- creating consistency here would also be helpful. In line with the original author, I would personally much appreciate this addition, since it would allow for basic form processing without javascript, and thereby provide graceful degradation for CouchDB-based web apps. > _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 > > 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. - You can reply to this email to add a comment to the issue online.