From a4c33e6bac9e449a596b12c80d99dc31c32ce75f Mon Sep 17 00:00:00 2001 From: OlgunR Date: Mon, 1 Jun 2026 15:43:16 +0200 Subject: [PATCH] Add MIME type mappings for .mjs and .ftl files Updated the `Program.cs` file to enhance static file handling: - Corrected the comment for `.mjs` MIME type registration. - Added a new MIME type mapping for `.ftl` files as `text/plain`. - Updated `UseStaticFiles` middleware to use a `StaticFileOptions` object with the modified `ContentTypeProvider`. These changes ensure proper serving of `.mjs` and `.ftl` files with appropriate content type headers. --- DXApp.TemplateKitProject/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DXApp.TemplateKitProject/Program.cs b/DXApp.TemplateKitProject/Program.cs index eaa4252..581ccd3 100644 --- a/DXApp.TemplateKitProject/Program.cs +++ b/DXApp.TemplateKitProject/Program.cs @@ -29,9 +29,10 @@ if (!app.Environment.IsDevelopment()) app.UseHttpsRedirection(); -// .mjs MIME-Type für PDF.js registrieren (einmaliger UseStaticFiles-Aufruf) +// MIME-Types für PDF.js registrieren (einmaliger UseStaticFiles-Aufruf) var provider = new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider(); provider.Mappings[".mjs"] = "text/javascript"; +provider.Mappings[".ftl"] = "text/plain"; app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = provider }); app.UseRouting();