couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Bénel <aurelien.be...@utt.fr>
Subject Re: Sending a redirect from a list
Date Tue, 30 Nov 2010 06:51:14 GMT
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?


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