fix: allow embedded worker API requests
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/tag/release-backend Pipeline was successful

This commit is contained in:
justme committed 2026-10-02 14:12:14 +08:00
1 parent 10ea48bf04
commit c68acfd78b
2 files changed
+8 -3

No files matched your search

@@ -87,7 +87,9 @@ public static class EmbeddedFrontend
? "public, max-age=31536000, immutable"
: "no-store";
if (path.Equals("index.html", StringComparison.Ordinal))
// Dedicated workers enforce the CSP returned with their own script response.
// Give bundled JS the same app policy so the crypto worker can call the same-origin API.
if (path.Equals("index.html", StringComparison.Ordinal) || path.EndsWith(".js", StringComparison.OrdinalIgnoreCase))
context.Response.Headers["Content-Security-Policy"] = contentSecurityPolicy;
if (!HttpMethods.IsHead(context.Request.Method))