mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Add support for avif (#1812)
This commit is contained in:
parent
ac729c619c
commit
d92dd7ea3b
@ -3,6 +3,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@ -49,12 +50,16 @@ namespace Bit.Server
|
||||
}
|
||||
else if (configuration.GetValue<bool?>("webVault") ?? false)
|
||||
{
|
||||
// TODO: This should be removed when asp.net natively support avif
|
||||
var provider = new FileExtensionContentTypeProvider { Mappings = { [".avif"] = "image/avif" } };
|
||||
|
||||
var options = new DefaultFilesOptions();
|
||||
options.DefaultFileNames.Clear();
|
||||
options.DefaultFileNames.Add("index.html");
|
||||
app.UseDefaultFiles(options);
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
ContentTypeProvider = provider,
|
||||
OnPrepareResponse = ctx =>
|
||||
{
|
||||
if (!ctx.Context.Request.Path.HasValue ||
|
||||
|
Loading…
Reference in New Issue
Block a user