From 757c1d5c859318068dd0f1f5d736ba9bd10eb606 Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Thu, 4 Jun 2026 17:40:10 -0400 Subject: [PATCH 1/2] fix: add UseStaticFiles() after UseAntiforgery() so JS audio module is served with correct Content-Type in production --- DeepDrftPublic/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DeepDrftPublic/Program.cs b/DeepDrftPublic/Program.cs index 36921d4..65479e9 100644 --- a/DeepDrftPublic/Program.cs +++ b/DeepDrftPublic/Program.cs @@ -75,6 +75,7 @@ else // Antiforgery is required by Blazor form handling. Authentication / authorization // middleware is intentionally absent — this host is fully anonymous. app.UseAntiforgery(); +app.UseStaticFiles(); // Configure cache headers for Blazor WebAssembly assets if (app.Environment.IsDevelopment()) From 58a94fe315ac6c128ce9eead6a543f940cd2cdf4 Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Thu, 4 Jun 2026 17:42:15 -0400 Subject: [PATCH 2/2] docs: explain why UseStaticFiles is not redundant with MapStaticAssets --- DeepDrftPublic/Program.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DeepDrftPublic/Program.cs b/DeepDrftPublic/Program.cs index 65479e9..d96d438 100644 --- a/DeepDrftPublic/Program.cs +++ b/DeepDrftPublic/Program.cs @@ -75,6 +75,9 @@ else // Antiforgery is required by Blazor form handling. Authentication / authorization // middleware is intentionally absent — this host is fully anonymous. app.UseAntiforgery(); +// UseStaticFiles runs before endpoint dispatch and ensures wwwroot/ files (e.g. /js/audio/*.js) +// are served with correct Content-Type. MapStaticAssets alone can drop the header on +// compressed assets; removing this call breaks the audio interop module in production. app.UseStaticFiles(); // Configure cache headers for Blazor WebAssembly assets