Fix production worker isolation headers
This commit is contained in:
18
nginx.conf
18
nginx.conf
@@ -31,17 +31,35 @@ server {
|
|||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /imgly/ {
|
||||||
|
try_files $uri =404;
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /favicon.svg {
|
location = /favicon.svg {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
expires 30d;
|
expires 30d;
|
||||||
add_header Cache-Control "public";
|
add_header Cache-Control "public";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /config.js {
|
location = /config.js {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
expires -1;
|
expires -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,16 @@ function runPluginInWorker<TOptions>(
|
|||||||
const onError = (e: ErrorEvent) => {
|
const onError = (e: ErrorEvent) => {
|
||||||
cleanup();
|
cleanup();
|
||||||
discardPluginWorker(plugin, worker);
|
discardPluginWorker(plugin, worker);
|
||||||
reject(new Error("Worker error: " + e.message));
|
const location = e.filename
|
||||||
|
? ` (${e.filename}${e.lineno ? `:${e.lineno}:${e.colno}` : ""})`
|
||||||
|
: "";
|
||||||
|
reject(
|
||||||
|
new Error(
|
||||||
|
`Worker failed to load or execute${location}: ${
|
||||||
|
e.message || "check worker, CORS, and cross-origin isolation headers"
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
context.signal.addEventListener("abort", onAbort);
|
context.signal.addEventListener("abort", onAbort);
|
||||||
|
|||||||
Reference in New Issue
Block a user