fix: Add explicit MIME type configuration for static files
Deploy to Production / Build & Deploy to Production (push) Failing after 59s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 10s
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 8s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped

- Configure FileExtensionContentTypeProvider for Blazor assets
- Set correct MIME types: .wasm, .js, .mjs, .json, .svg, .woff, .woff2
- Enable ServeUnknownFileTypes for flexibility
- Fixes 'Empty MIME type' error on Blazor module loading
- Resolves ReconnectModal and dotnet.js loading failures

MIME type mapping:
- .wasm → application/wasm
- .js → application/javascript
- .mjs → application/javascript
- .json → application/json
- .svg → image/svg+xml
- .woff → font/woff
- .woff2 → font/woff2

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 15:41:13 +09:00
parent 996f614a4e
commit d12dee3278
19 changed files with 31 additions and 13 deletions
+18
View File
@@ -8,6 +8,7 @@ using QuantEngine.Core.Interfaces;
using QuantEngine.Application.Services; using QuantEngine.Application.Services;
using QuantEngine.Application.Interfaces; using QuantEngine.Application.Interfaces;
using System.Text.Json; using System.Text.Json;
using Microsoft.AspNetCore.StaticFiles;
using static QuantEngine.Application.Services.DataCollectionService; using static QuantEngine.Application.Services.DataCollectionService;
using Serilog; using Serilog;
using QuantEngine.Web.Client.Infrastructure; using QuantEngine.Web.Client.Infrastructure;
@@ -121,6 +122,23 @@ app.UseStatusCodePages(async ctx =>
app.UseHttpsRedirection(); app.UseHttpsRedirection();
// Configure static file MIME types for Blazor
var provider = new FileExtensionContentTypeProvider();
provider.Mappings[".wasm"] = "application/wasm";
provider.Mappings[".js"] = "application/javascript";
provider.Mappings[".mjs"] = "application/javascript";
provider.Mappings[".json"] = "application/json";
provider.Mappings[".svg"] = "image/svg+xml";
provider.Mappings[".woff"] = "font/woff";
provider.Mappings[".woff2"] = "font/woff2";
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider,
ServeUnknownFileTypes = true,
DefaultContentType = "application/octet-stream"
});
app.UseAntiforgery(); app.UseAntiforgery();
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
@@ -5,7 +5,7 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
"mainAssemblyName": "QuantEngine.Web.Client", "mainAssemblyName": "QuantEngine.Web.Client",
"applicationEnvironment": "Development", "applicationEnvironment": "Development",
"resources": { "resources": {
"hash": "sha256-GF7r7nIOeI3J063bMscMxkHPkyz0z2peQDukfM6M9AA=", "hash": "sha256-BbBW2IDSn0CdFcShrDBJDn0eBaTMXAiaarfp1y6lFWk=",
"jsModuleNative": [ "jsModuleNative": [
{ {
"name": "dotnet.native.ikrs475e5v.js" "name": "dotnet.native.ikrs475e5v.js"
@@ -1254,14 +1254,14 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
}, },
{ {
"virtualPath": "QuantEngine.Application.wasm", "virtualPath": "QuantEngine.Application.wasm",
"name": "QuantEngine.Application.9qbkx9qe02.wasm", "name": "QuantEngine.Application.n4x9btwro5.wasm",
"hash": "sha256-n+LsYnNV5pamOyWoF7751imN+T6/3o/betNZTmDBIm8=", "hash": "sha256-906kYBkYAJkZ80yppIUgSbv1/wGdYrbGBn8QhpAJfr4=",
"cache": "force-cache" "cache": "force-cache"
}, },
{ {
"virtualPath": "QuantEngine.Core.wasm", "virtualPath": "QuantEngine.Core.wasm",
"name": "QuantEngine.Core.fjtcuzx1xx.wasm", "name": "QuantEngine.Core.i44o8ctubr.wasm",
"hash": "sha256-dUUtuk/3Sq+D/HHVdY3qc1fEYvcEjMsrPhWZbxZiuzk=", "hash": "sha256-Hs1Kn2eitkbbEFeAJgeoc9vfF1zyWpqJ7SvCTk32ct8=",
"cache": "force-cache" "cache": "force-cache"
}, },
{ {
@@ -1272,28 +1272,28 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
}, },
{ {
"virtualPath": "QuantEngine.Web.Client.wasm", "virtualPath": "QuantEngine.Web.Client.wasm",
"name": "QuantEngine.Web.Client.46e6s1s51k.wasm", "name": "QuantEngine.Web.Client.pdma2c1xbe.wasm",
"hash": "sha256-xDLl5C/imN2X6hA/ZRehlbT7FiFksdwYU2yHv8FBK3U=", "hash": "sha256-zdGCsCDg32wjxUCzPmUpZVMYNDMuL1vgELQb8vKxLGA=",
"cache": "force-cache" "cache": "force-cache"
} }
], ],
"pdb": [ "pdb": [
{ {
"virtualPath": "QuantEngine.Core.pdb", "virtualPath": "QuantEngine.Core.pdb",
"name": "QuantEngine.Core.svjnfkgy0u.pdb", "name": "QuantEngine.Core.b5f9o8o2rh.pdb",
"hash": "sha256-mHzMWzrz2+iHyGpoMNApxy6akFJhGvAuQ4s2zpheP+s=", "hash": "sha256-ERM43ExyTsX4AW+yYK1fSfBUMXaXmvvaJ1cIeR/SCiw=",
"cache": "force-cache" "cache": "force-cache"
}, },
{ {
"virtualPath": "QuantEngine.Application.pdb", "virtualPath": "QuantEngine.Application.pdb",
"name": "QuantEngine.Application.7revtw31g8.pdb", "name": "QuantEngine.Application.kv7x4sl21n.pdb",
"hash": "sha256-jXaCcUqetbTVj0fTCW4soVlUrGJrHE5Yzb1aVyhayX8=", "hash": "sha256-4BWS2CnkvmzfOpWqZLkmWCs4mxeHLul3OrN6abwzAtU=",
"cache": "force-cache" "cache": "force-cache"
}, },
{ {
"virtualPath": "QuantEngine.Web.Client.pdb", "virtualPath": "QuantEngine.Web.Client.pdb",
"name": "QuantEngine.Web.Client.m7znbxtyme.pdb", "name": "QuantEngine.Web.Client.97rik53991.pdb",
"hash": "sha256-/o7OFFiYQrm0GzWXW1CJtBjVW2egit6y5bsgQqmw2Sk=", "hash": "sha256-NZJNG8Bfp8VRV7LXzXQm+NDBra0TwYyOvgMTwrcoHA0=",
"cache": "force-cache" "cache": "force-cache"
} }
], ],