Closed raresp closed 12 years ago
Probably just a simple middleware like this:
function AccessControlMiddleware(app) {
return function(env) {
var response = app(env);
HashP.set(response.headers, "Access-Control-Allow-Origin", "VALUE HERE");
return response;
}
}
Thanks for your quick response. Where shall I declare and register this function? Couldn't find any tutorials on how to do that. Thanks again.
Sent from my iPhone
On May 22, 2012, at 6:17 AM, Tom Robinson reply@reply.github.com wrote:
Probably just a simple middleware like this:
function AccessControlMiddleware(app) { return function(env) { var response = app(env); HashP.set(response.headers, "Access-Control-Allow-Origin", "VALUE HERE"); return response; } }
Reply to this email directly or view it on GitHub: https://github.com/tlrobinson/narwhal/issues/109#issuecomment-5838750
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
I've added this function to jackconfig.js but I am getting an error:
ReferenceError: Can't find variable: HashP
On May 22, 2012, at 6:17 AM, Tom Robinson wrote:
Probably just a simple middleware like this:
function AccessControlMiddleware(app) { return function(env) { var response = app(env); HashP.set(response.headers, "Access-Control-Allow-Origin", "VALUE HERE"); return response; } }
Reply to this email directly or view it on GitHub: https://github.com/tlrobinson/narwhal/issues/109#issuecomment-5838750
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Rares Pop Chief Executive M: +40 745 028 869 | E: raresp@axz.ro | Skype: ra_axz www.azoth.eu | A: Grigore Alexandrescu 54, Bucuresti - Romania
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
I'm not sure if we still include HashP. This should work fine instead but it's not case sensitive:
response.headers["Access-Control-Allow-Origin"] = "VALUE HERE";
Hi,
What would I need to do to have my own Access-Control-Allow-Origin header in all responses?
Thank you, Rares