mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 05:04:56 +08:00
✨ feat: 支持配置泛域名
This commit is contained in:
@@ -30,7 +30,7 @@ app.use(
|
||||
// 可写为数组
|
||||
origin: (origin) => {
|
||||
// 是否指定域名
|
||||
const isSame = origin.endsWith(config.ALLOWED_HOST);
|
||||
const isSame = config.ALLOWED_HOST && origin.endsWith(config.ALLOWED_HOST);
|
||||
return isSame ? origin : config.ALLOWED_DOMAIN;
|
||||
},
|
||||
allowMethods: ["POST", "GET", "OPTIONS"],
|
||||
|
||||
Reference in New Issue
Block a user