Skip to content

Commit

Permalink
Apply CORS also to .mjs files (dotnet#108656)
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf authored Oct 8, 2024
1 parent 848cabd commit d5cb4cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mono/wasm/host/DevServer/DevServerStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void Configure(IApplicationBuilder app, IOptions<DevServerOptions>
if (ctx.Request.Path.StartsWithSegments("/_framework") && !ctx.Request.Path.StartsWithSegments("/_framework/blazor.server.js") && !ctx.Request.Path.StartsWithSegments("/_framework/blazor.web.js"))
{
string fileExtension = Path.GetExtension(ctx.Request.Path);
if (string.Equals(fileExtension, ".js"))
if (string.Equals(fileExtension, ".js") || string.Equals(fileExtension, ".mjs"))
{
// Browser multi-threaded runtime requires cross-origin policy headers to enable SharedArrayBuffer.
ApplyCrossOriginPolicyHeaders(ctx);
Expand Down

0 comments on commit d5cb4cd

Please sign in to comment.