From c70db96b0640aa9d7a01c1041eb8def9bd1d5437 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 8 Nov 2012 13:52:20 -0800 Subject: [PATCH] Update examples/cors/index.js --- examples/cors/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cors/index.js b/examples/cors/index.js index d92a387cc7..6698b7ad6a 100644 --- a/examples/cors/index.js +++ b/examples/cors/index.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ @@ -21,6 +20,7 @@ api.use(express.bodyParser()); */ api.all('*', function(req, res, next){ + if (!req.get('Origin')) return next(); // use "*" here to accept any origin res.set('Access-Control-Allow-Origin', 'http://localhost:3000'); res.set('Access-Control-Allow-Methods', 'GET, POST');