Permalink
Browse files

Update examples/cors/index.js

  • Loading branch information...
1 parent cb75184 commit c70db96b0640aa9d7a01c1041eb8def9bd1d5437 @tj tj committed Nov 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 examples/cors/index.js
View
2 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');

0 comments on commit c70db96

Please sign in to comment.