couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: Sending a redirect from a list
Date Tue, 30 Nov 2010 06:58:15 GMT
On Tue, Nov 30, 2010 at 1:51 AM, Aurélien Bénel <aurelien.benel@utt.fr> wrote:
> Thanks for your answer, Paul.
>
>> Unfortunately, the current list behaviour doesn't allow you to modify response headers
after calling getRow().
>
>
> Oh, too bad...
> Is there a plan to change this behaviour?
>

There have been suggestions to changing that API. I would currently
rate the timescale for such a change on the order of months to a year.
Definitely no discussions have suggested anything in the next couple
releases.

Although, an interested developer that provided patches might be able
to seriously contract that timeline ;)

HTH,
Paul Davis

>
> Aurélien
>
>
>>> I'm trying to send a redirect from a list with the following code:
>>>
>>> function (head, req) {
>>>  var row = getRow();
>>>  if (row) {
>>>   var url = "/";   // Will be computed from row
>>>   return {"code": 302, "headers":{ "Location": url}};
>>>  } else {
>>>   return({"code": 404, "body": "Not here"});
>>>  }
>>> }
>

Mime
View raw message