From user-return-6577-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Sep 25 03:51:17 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 26748 invoked from network); 25 Sep 2009 03:51:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Sep 2009 03:51:17 -0000 Received: (qmail 34849 invoked by uid 500); 25 Sep 2009 03:51:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 34719 invoked by uid 500); 25 Sep 2009 03:51:16 -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 34709 invoked by uid 99); 25 Sep 2009 03:51:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Sep 2009 03:51:15 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zachary.zolton@gmail.com designates 209.85.220.209 as permitted sender) Received: from [209.85.220.209] (HELO mail-fx0-f209.google.com) (209.85.220.209) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Sep 2009 03:51:07 +0000 Received: by fxm5 with SMTP id 5so1788751fxm.3 for ; Thu, 24 Sep 2009 20:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=F4j1XUOlgnGlvrh8F0Kgr/e0sHBJxw6MPYCULvUg9eI=; b=P0TDMO0cQyYVgSvxfTKkQTu9gOiwUaIMUCSXS/Dm9f/mSSgnBqk6tgImrv2vsFjIpH SPQzVbI6aujcQpQndjrOTeDcaNYMjif9qO0piD47pLtV8nqBIsn5WsWxJNVPCcnRHSUC UakGfki4ATWw6eFDrdNtocxIMBWN2yub0Gj+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=uk0oYb9iNrXFzG4owRxXiVecBGpxqrOiftTdSi/mXvWGjUESXauzi3ytQHSDFAGKEd 3luT99ocj3cDmpED58JeBJMxeH9O7bipaVj2CkauI4700OVydFzacEEpbLDMQpIB+SJS U8MdTzWViSUsCFJ3xXnLLZc1pBAFv2Kn34dag= MIME-Version: 1.0 Received: by 10.204.32.76 with SMTP id b12mr3351492bkd.165.1253850646344; Thu, 24 Sep 2009 20:50:46 -0700 (PDT) In-Reply-To: References: From: Zachary Zolton Date: Thu, 24 Sep 2009 22:50:26 -0500 Message-ID: Subject: Re: Redirect from _list function? To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org So, can anyone give a reason why this _list function shouldn't work? On Thu, Sep 24, 2009 at 5:34 PM, Zachary Zolton wrote: > Hello, > > Should I be able to do a redirect from a _list function? > > I ask because I've tried defining the following _list function: > > function(head, req) { > =A0return { > =A0 =A0'code': 301, > =A0 =A0'headers': { 'Location': 'http://www.google.com/' } > =A0}; > } > > And, here's what happens when I try to hit it: > > $ curl -i 'http://localhost:5984/db/_design/ddoc/_list/test-redirect/some= -view?key=3D%22foo%22' > HTTP/1.1 200 OK > Vary: Accept > Transfer-Encoding: chunked > Server: CouchDB/0.11.0a9fd42dc1-git (Erlang OTP/R12B) > Etag: "46014W5JDRLKZF5SECP2D44YH" > Date: Thu, 24 Sep 2009 22:23:14 GMT > Content-Type: application/json > > curl: (56) Received problem 2 in the chunky parser > > Obviously, this does not look like a redirect. =A0:^( =A0Do I seem to be > doing anything wrong here? > > > Thanks! > > Zach >