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 F1B2F10EE1 for ; Tue, 17 Sep 2013 13:35:45 +0000 (UTC) Received: (qmail 1670 invoked by uid 500); 17 Sep 2013 13:35:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 1541 invoked by uid 500); 17 Sep 2013 13:35:26 -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 1499 invoked by uid 99); 17 Sep 2013 13:35:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 13:35:23 +0000 X-ASF-Spam-Status: No, hits=2.4 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_FAIL X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: encountered temporary error during SPF processing of domain of bernhard@unserwein.at) Received: from [209.85.212.41] (HELO mail-vb0-f41.google.com) (209.85.212.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 13:35:16 +0000 Received: by mail-vb0-f41.google.com with SMTP id g17so4142642vbg.28 for ; Tue, 17 Sep 2013 06:34:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=wE7kulTgLmg/NHmUjuOyxATDnjWpqyaCbYw/edIQ0+c=; b=K6p7M6c/KCoGpMH+LWCrR7Qy3YXY8UZKgnSOgtGpnWG89MosTUV6/1QSgUgOhpKcai 3C6P6aDw/1nL3bt+f7KyBpMJ+VzccP9pQRwMZrZ5PzHsFdTHqcfvpWD7oqao2rJaHE3V tlLLdNHO5ehgtxeAY5JvqhvVwdg4U4mgtFT6DwA4LDJA1FP0QTZxtA2eOUJWivqSbpWO JHAfTwVDCUlTTvz46TkHAUsi6Ay8j4xFQPZXw57xB83Q7aJaXLD/QxILgcvBGlOqgSJA lnnLnuWqTHQRrVbGvw8PKHpF5wDxLUJVNB1IgKM/7BryefoACJedHLYzn3vvlgiTCDhl 4ERA== X-Gm-Message-State: ALoCoQk2mGSm/Ihggn+Ep9e3Snlic22Bn1xhwAg0PtxOBCWp8RDedhqfVoVRZjrbdRoNBOpwBFKK X-Received: by 10.220.237.208 with SMTP id kp16mr32337669vcb.4.1379424874544; Tue, 17 Sep 2013 06:34:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.117.98 with HTTP; Tue, 17 Sep 2013 06:34:04 -0700 (PDT) X-Originating-IP: [83.65.119.62] From: Bernhard Gschwantner Date: Tue, 17 Sep 2013 15:34:04 +0200 Message-ID: Subject: Redirects from _list functions in CouchDB 1.4 To: "user@couchdb.apache.org" Content-Type: multipart/alternative; boundary=047d7b343464a453cf04e694611f X-Virus-Checked: Checked by ClamAV on apache.org --047d7b343464a453cf04e694611f Content-Type: text/plain; charset=UTF-8 Hello, I tried to redirect from a _list function without success. This code throws a badarg error in CouchDB 1.4.0 (also in 1.2 and 1.3): function(head, req) { return { code : 301, headers : { Location : 'http://www.google.com' } }; } Is there something I am doing wrong or missing? The real-world use case is that we have several aliases to each document in the db, and all those aliases should be redirected to the real document id. We use a view to emit the aliases and a list function to redirect all those aliases to the real url. We've been working around the previous issues with modifying headers after getRow() by redirecting through JavaScript, but want to get rid of this workaround eventually. Regards, Bernhard -- Bernhard Gschwantner Unser Wein G&U OG Kirchengasse 13/7, 1070 Wien mobil: +43 (6991) 971 32 96 tel: +43 (1) 971 32 95 e-mail: bernhard@unserwein.at twitter: @bernharduw web: www.unserwein.at --047d7b343464a453cf04e694611f--