Skip to content

Commit c7a5173

Browse files
committed
CORS fixes.
1 parent 0c23011 commit c7a5173

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ app.use(morgan('common'));
2020
// CORS
2121
app.use(function (req, res, next) {
2222
res.header('Access-Control-Allow-Origin', '*');
23-
res.header('Access-Control-Allow-Headers', 'Content-Type');
23+
res.header('Access-Control-Allow-Headers', 'Content-Type,Authorization');
2424
res.header('Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE');
25+
if (req.method === 'OPTIONS') {
26+
return res.send(204);
27+
}
2528
next();
2629
});
2730

0 commit comments

Comments
 (0)