Skip to content

Commit 2e90e36

Browse files
authored
设置Access-Control-Allow-Headers
1 parent 42f8e76 commit 2e90e36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ app.use(cookieParser());
3232
app.use(express.static(path.join(__dirname, 'public')));
3333

3434
//use nginx in production
35-
if (app.get('env') === 'development') {
35+
//if (app.get('env') === 'development') {
3636
log.debug("set Access-Control Header");
3737
app.all('*', function(req, res, next) {
3838
res.header("Access-Control-Allow-Origin", "*");
39-
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
39+
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization, X-CodePush-Plugin-Version, X-CodePush-Plugin-Name, X-CodePush-SDK-Version");
4040
res.header("Access-Control-Allow-Methods","PUT,POST,GET,PATCH,DELETE,OPTIONS");
4141
log.debug("use set Access-Control Header");
4242
next();
4343
});
44-
}
44+
//}
4545

4646
log.debug("config common.storageType value: " + _.get(config, 'common.storageType'));
4747

0 commit comments

Comments
 (0)