From f13257d616738869e142362b41641dbeef1dbbf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 8 Oct 2024 12:13:28 +0200 Subject: [PATCH] Apply CORS also to .mjs files --- src/Components/WebAssembly/DevServer/src/Server/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/WebAssembly/DevServer/src/Server/Startup.cs b/src/Components/WebAssembly/DevServer/src/Server/Startup.cs index 046031a29f79..d23291a6dbd9 100644 --- a/src/Components/WebAssembly/DevServer/src/Server/Startup.cs +++ b/src/Components/WebAssembly/DevServer/src/Server/Startup.cs @@ -42,7 +42,7 @@ public static void Configure(IApplicationBuilder app, IConfiguration configurati else if (applyCopHeaders && ctx.Request.Path.StartsWithSegments("/_framework") && !ctx.Request.Path.StartsWithSegments("/_framework/blazor.server.js") && !ctx.Request.Path.StartsWithSegments("/_framework/blazor.web.js")) { var fileExtension = Path.GetExtension(ctx.Request.Path); - if (string.Equals(fileExtension, ".js", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(fileExtension, ".js", StringComparison.OrdinalIgnoreCase) || string.Equals(fileExtension, ".mjs", StringComparison.OrdinalIgnoreCase)) { // Browser multi-threaded runtime requires cross-origin policy headers to enable SharedArrayBuffer. ApplyCrossOriginPolicyHeaders(ctx);