fix: blob sync

This commit is contained in:
DarkSky
2026-01-03 01:40:13 +08:00
parent 9a7f8e7d4d
commit 41addfe311

View File

@@ -172,9 +172,13 @@ function ensureFrameAncestors(
});
}
function allowCors(headers: Record<string, string[]>) {
function allowCors(
headers: Record<string, string[]>,
origin: string = 'assets://.'
) {
// Signed blob URLs redirect to *.usercontent.affine.pro without CORS headers.
setHeader(headers, 'Access-Control-Allow-Origin', '*');
setHeader(headers, 'Access-Control-Allow-Origin', origin);
setHeader(headers, 'Access-Control-Allow-Credentials', 'true');
setHeader(headers, 'Access-Control-Allow-Methods', 'GET, HEAD, OPTIONS');
setHeader(
headers,