incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Gschwantner <bernh...@unserwein.at>
Subject Redirects from _list functions in CouchDB 1.4
Date Tue, 17 Sep 2013 13:34:04 GMT
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 <http://twitter.com/bernharduw>
web: www.unserwein.at

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message