feat(cors): add Access-Control-Allow-Credentials header for CORS support

This commit is contained in:
shuaiplus
2026-03-09 00:52:24 +08:00
parent 899f1004a3
commit 1285f6296e
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -54,6 +54,7 @@ function buildCorsHeaders(request: Request): Record<string, string> {
const allowedOrigin = getAllowedOrigin(request); const allowedOrigin = getAllowedOrigin(request);
if (allowedOrigin) { if (allowedOrigin) {
headers['Access-Control-Allow-Origin'] = allowedOrigin; headers['Access-Control-Allow-Origin'] = allowedOrigin;
headers['Access-Control-Allow-Credentials'] = 'true';
headers['Vary'] = 'Origin'; headers['Vary'] = 'Origin';
} }
+1 -1
View File
@@ -23,4 +23,4 @@ binding = "ATTACHMENTS_KV"
[[migrations]] [[migrations]]
tag = "v1-notifications-hub" tag = "v1-notifications-hub"
new_sqlite_classes = ["NotificationsHub"] new_sqlite_classes = [ "NotificationsHub" ]