Skip to content

Commit 01e9af2

Browse files
committed
fix avif bg
1 parent 1dbff5c commit 01e9af2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/BE/Program.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Microsoft.AspNetCore.Mvc;
1212
using System.Runtime.CompilerServices;
1313
using Chats.BE.Services.FileServices;
14+
using Microsoft.AspNetCore.StaticFiles;
1415

1516
[assembly: InternalsVisibleTo("Chats.BE.Tests")]
1617

@@ -81,6 +82,13 @@ public static async Task Main(string[] args)
8182
app.MapControllers();
8283
app.UseMiddleware<FrontendMiddleware>();
8384
app.UseStaticFiles();
85+
app.UseStaticFiles(new StaticFileOptions()
86+
{
87+
ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary<string, string>
88+
{
89+
[".avif"] = "image/avif",
90+
})
91+
});
8492

8593
// before run:
8694
await app.Services.GetRequiredService<InitService>().Init();

0 commit comments

Comments
 (0)