Skip to content

Commit 3985f6a

Browse files
author
Lloyd Watkin
committed
Set origin to '*' if not available
1 parent 309f863 commit 3985f6a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ function setupConfig(app) {
4747
}
4848

4949
function crossOriginAllower(req, res, next) {
50-
var origin = req.header('Origin', '*');
51-
if (origin == 'null') {
52-
origin = '*';
53-
}
50+
51+
var origin = req.headers['origin'] || '*';
5452

5553
res.header('Access-Control-Allow-Origin', origin);
5654
res.header('Access-Control-Allow-Credentials', 'true');

0 commit comments

Comments
 (0)