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.
This commit is contained in:
OlgunR
2026-06-01 15:43:16 +02:00
parent 346750e933
commit a4c33e6bac

View File

@@ -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();