Always add Origin to Vary header

This commit is contained in:
2024-06-03 13:44:08 +08:00
parent e43d21c1e8
commit cd8a7aca61

View File

@@ -26,8 +26,8 @@ export async function handler(req: Request, ctx: FreshContext) {
const c = m.cfg.cors_credentials_hosts.includes(origin);
headers.set("Access-Control-Allow-Origin", origin);
if (c) headers.set("Access-Control-Allow-Credentials", "true");
headers.append("Vary", "Origin");
}
headers.append("Vary", "Origin");
return new Response(res.body, {
status: res.status,
headers: headers,