This commit is contained in:
2023-08-30 14:55:30 +08:00
parent 7d3cb01cda
commit faf7a9fcf2
2 changed files with 2 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ export async function handler(req: Request, ctx: MiddlewareHandlerContext) {
const origin = req.headers.get("origin");
if (origin) {
headers.set("Access-Control-Allow-Origin", origin);
headers.set("Access-Control-Allow-Credentials", "true");
}
if (ctx.state.is_from_cookie && ctx.state.token) {
const m = get_task_manager();

View File

@@ -20,6 +20,7 @@ export async function handler(req: Request, ctx: MiddlewareHandlerContext) {
const origin = req.headers.get("origin");
if (origin) {
headers.set("Access-Control-Allow-Origin", origin);
headers.set("Access-Control-Allow-Credentials", "true");
}
return new Response(res.body, {
status: res.status,