Skip to content

Commit c70db96

Browse files
committed
Update examples/cors/index.js
1 parent cb75184 commit c70db96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/cors/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/
@@ -21,6 +20,7 @@ api.use(express.bodyParser());
2120
*/
2221

2322
api.all('*', function(req, res, next){
23+
if (!req.get('Origin')) return next();
2424
// use "*" here to accept any origin
2525
res.set('Access-Control-Allow-Origin', 'http://localhost:3000');
2626
res.set('Access-Control-Allow-Methods', 'GET, POST');

0 commit comments

Comments
 (0)