Update server.js

This commit is contained in:
IamFurina 2025-03-23 15:07:05 +08:00 committed by ImFurina
parent f35c198c4e
commit 614e733fd1

View File

@ -147,7 +147,7 @@ async function consturctServer(moduleDefs) {
if (req.path !== '/' && !req.path.includes('.')) {
res.set({
'Access-Control-Allow-Credentials': true,
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Origin': CORS_ALLOW_ORIGIN || req.headers.origin || '*',
'Access-Control-Allow-Headers': 'X-Requested-With,Content-Type',
'Access-Control-Allow-Methods': 'PUT,POST,GET,DELETE,OPTIONS',
'Content-Type': 'application/json; charset=utf-8',