1.4.24:CORS 自動放行同實例 portal(不再依賴 UI_ORIGINS)+診斷端點+portal 導流文案
This commit is contained in:
@@ -14681,7 +14681,9 @@ app.use("*", cors({
|
||||
extra = String(c.env.UI_ORIGINS || "").split(",").map((s) => s.trim()).filter(Boolean);
|
||||
} catch {
|
||||
}
|
||||
return [...STATIC_ORIGINS, ...extra].includes(origin) ? origin : null;
|
||||
const sub = String(c.env.WORKER_SUBDOMAIN || "").trim();
|
||||
const sibling = sub ? [`https://arcrun-rag-ui.${sub}.workers.dev`] : [];
|
||||
return [...STATIC_ORIGINS, ...sibling, ...extra].includes(origin) ? origin : null;
|
||||
},
|
||||
allowMethods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
|
||||
allowHeaders: ["Content-Type", "Authorization", "X-Arcrun-API-Key"],
|
||||
|
||||
Reference in New Issue
Block a user