From 415c1605b7607ee119fef7b6146bb88dc5324773 Mon Sep 17 00:00:00 2001 From: Mia Winter Date: Fri, 2 Feb 2024 16:51:56 +0100 Subject: [PATCH] fixed jxl files not being served --- Wave/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Wave/Program.cs b/Wave/Program.cs index 3d74f6e..5e69144 100644 --- a/Wave/Program.cs +++ b/Wave/Program.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption; using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel; using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.StaticFiles; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.Metrics; @@ -133,7 +134,13 @@ app.UseExceptionHandler("/Error", createScopeForErrors: true); } -app.UseStaticFiles(); +app.UseStaticFiles(new StaticFileOptions { + ContentTypeProvider = new FileExtensionContentTypeProvider { + Mappings = { + [".jxl"] = "image/jxl" + } + } +}); app.UseAntiforgery(); app.MapRazorComponents().AddInteractiveServerRenderMode();