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
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:
@@ -8,6 +8,7 @@ using QuantEngine.Core.Interfaces;
|
||||
using QuantEngine.Application.Services;
|
||||
using QuantEngine.Application.Interfaces;
|
||||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using static QuantEngine.Application.Services.DataCollectionService;
|
||||
using Serilog;
|
||||
using QuantEngine.Web.Client.Infrastructure;
|
||||
@@ -121,6 +122,23 @@ app.UseStatusCodePages(async ctx =>
|
||||
|
||||
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.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
Reference in New Issue
Block a user