Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 27743 invoked from network); 25 Sep 2009 03:59:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Sep 2009 03:59:33 -0000 Received: (qmail 39633 invoked by uid 500); 25 Sep 2009 03:59:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 39507 invoked by uid 500); 25 Sep 2009 03:59:32 -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 39497 invoked by uid 99); 25 Sep 2009 03:59:32 -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:59:32 +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 paul.joseph.davis@gmail.com designates 209.85.210.203 as permitted sender) Received: from [209.85.210.203] (HELO mail-yx0-f203.google.com) (209.85.210.203) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Sep 2009 03:59:24 +0000 Received: by yxe41 with SMTP id 41so2886914yxe.30 for ; Thu, 24 Sep 2009 20:59:03 -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 :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZHv4xJQLS1+uaQXBH98T3UuPaOLjfTxu7qZNsww5SDU=; b=BVcpnpS7S4z0pJMK0xEooCmv4+SWBzR1XiuLcvGKO9tsPJWqqo2DT+dKJKSUOkdX+9 bIWP9F6aZ8ZnLhAzuCboSnxdPeYPyF1oYryC7b9eFI3/8slyqKTJxcG9qkg5bgItgOKi JBv4A3m4mkyFhHCa2rpXdTnWDqN+KqU+d3vQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jiNU4+JQ/nd7YJShfhtdBC65rI0z81Hfv4GrlGZDgyEloimvzvfGzzk8fTKillvmYy HOW6wNfXGsHDMHzvvZX6F8BENNnPlemKa4kcK4Ubef1ESpMlZIQsmSPGX1N3v5P2YRoh wgG6krlXSZ3wVEwv8qQXc1etHlFqBWrVFq7Ok= MIME-Version: 1.0 Received: by 10.101.85.5 with SMTP id n5mr5371989anl.57.1253851143331; Thu, 24 Sep 2009 20:59:03 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Sep 2009 23:59:03 -0400 Message-ID: Subject: Re: Redirect from _list function? From: Paul Davis 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 Bit tired here but two thoughts. Theoretically returning a 304 should work fine I think. The question is what mutation happens when processing the _list. I'd suggest taking a glance at render.js to see if maybe you're getting caught by a corner case. Paul On Thu, Sep 24, 2009 at 11:50 PM, Zachary Zolton wrote: > 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/som= e-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 >> >