Skip to content

Commit 84fc997

Browse files
Added Cache-Control in CORs allowed headers
Some library set this header to avoid caching, but the browser will deny the COR request with `Request header field Cache-Control is not allowed by Access-Control-Allow-Headers in preflight response.`
1 parent 7c6ec06 commit 84fc997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function authenticate(code, cb) {
5454
app.all('*', function (req, res, next) {
5555
res.header('Access-Control-Allow-Origin', '*');
5656
res.header('Access-Control-Allow-Methods', 'GET, OPTIONS');
57-
res.header('Access-Control-Allow-Headers', 'Content-Type');
57+
res.header('Access-Control-Allow-Headers', 'Content-Type, Cache-Control');
5858
next();
5959
});
6060

0 commit comments

Comments
 (0)