fix: allow embedded worker API requests
This commit is contained in:
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))
|
||||
|
||||
Reference in new issue
Block a user