Skip to content

Commit 1ace2ac

Browse files
marafcaptainsafia
authored andcommitted
[Blazor] Apply CORS also to .mjs files (#58287)
1 parent eaad91f commit 1ace2ac

File tree

1 file changed

+1
-1
lines changed
  • src/Components/WebAssembly/DevServer/src/Server

1 file changed

+1
-1
lines changed

src/Components/WebAssembly/DevServer/src/Server/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static void Configure(IApplicationBuilder app, IConfiguration configurati
4242
else if (applyCopHeaders && ctx.Request.Path.StartsWithSegments("/_framework") && !ctx.Request.Path.StartsWithSegments("/_framework/blazor.server.js") && !ctx.Request.Path.StartsWithSegments("/_framework/blazor.web.js"))
4343
{
4444
var fileExtension = Path.GetExtension(ctx.Request.Path);
45-
if (string.Equals(fileExtension, ".js", StringComparison.OrdinalIgnoreCase))
45+
if (string.Equals(fileExtension, ".js", StringComparison.OrdinalIgnoreCase) || string.Equals(fileExtension, ".mjs", StringComparison.OrdinalIgnoreCase))
4646
{
4747
// Browser multi-threaded runtime requires cross-origin policy headers to enable SharedArrayBuffer.
4848
ApplyCrossOriginPolicyHeaders(ctx);

0 commit comments

Comments
 (0)