Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CF8D8F96 for ; Tue, 16 Aug 2011 16:23:38 +0000 (UTC) Received: (qmail 22741 invoked by uid 500); 16 Aug 2011 16:23:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 22694 invoked by uid 500); 16 Aug 2011 16:23:36 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 22686 invoked by uid 99); 16 Aug 2011 16:23:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2011 16:23:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jens@couchbase.com designates 206.225.164.28 as permitted sender) Received: from [206.225.164.28] (HELO EXHUB020-1.exch020.serverdata.net) (206.225.164.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2011 16:23:27 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.169]) by EXHUB020-1.exch020.serverdata.net ([206.225.164.28]) with mapi; Tue, 16 Aug 2011 09:23:07 -0700 From: Jens Alfke To: "user@couchdb.apache.org" Date: Tue, 16 Aug 2011 09:23:06 -0700 Subject: Re: to CouchApp or not to CouchApp Thread-Topic: to CouchApp or not to CouchApp Thread-Index: AcxcMMfZUnxeLjCFQcWFT8z0RNRaHQ== Message-ID: References: <4E371B93.8060303@kearns.net.au> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_C9195240BB0544A5AE1311AA5B338ADBcouchbasecom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_C9195240BB0544A5AE1311AA5B338ADBcouchbasecom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On Aug 16, 2011, at 9:06 AM, Robert Newson wrote: Talk of 'following the standard' while preserving the behavior of returning a 302 for an unauthorized request is contradictory. We're deliberately not following the standard 401 response here because the universal user agent behavior we'd get is unpalatable. Yeah, this is a hack. It=92s mixing up =91CouchDB as REST data store=92 wit= h =91CouchDB as web-app server=92. Returning a 302 might be appropriate at = an application layer, but it=92s absolutely not at the REST/database layer. Using the browser Accept header to determine behavior seems like the wrong = thing to do, as it=92s only tenuously connected to the actual database/app = dichotomy. (What if I=92m asking the database to fetch an attachment whose = type is known to be text/html?) Couldn=92t the CouchApp define some kind of handler to be called in case of= unauthorized access, and that handler could then decide to return a 302? =97Jens --_000_C9195240BB0544A5AE1311AA5B338ADBcouchbasecom_--