Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderssonPeter committed Mar 23, 2024
1 parent 16b0e61 commit a0fdef8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CompressedStaticFiles/CompressedAlternativeFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class CompressedAlternativeFileProvider : IAlternativeFileProvider
{
{ "gzip", ".gz" },
{ "br", ".br" },
{ "br", ".br" },
{ "zstd", ".zst" }
};

Expand All @@ -33,8 +32,13 @@ public CompressedAlternativeFileProvider(ILogger<CompressedAlternativeFileProvid
public void Initialize(FileExtensionContentTypeProvider fileExtensionContentTypeProvider)
{
// the StaticFileProvider would not serve the file if it does not know the content-type
fileExtensionContentTypeProvider.Mappings[".br"] = "application/brotli";
fileExtensionContentTypeProvider.Mappings[".zst"] = "application/zstd";
if (!fileExtensionContentTypeProvider.Mappings.ContainsKey(".br")) {
fileExtensionContentTypeProvider.Mappings[".br"] = "application/brotli";
}
if (!fileExtensionContentTypeProvider.Mappings.ContainsKey(".zst"))
{
fileExtensionContentTypeProvider.Mappings[".zst"] = "application/zstd";
}
}

/// <summary>
Expand Down

0 comments on commit a0fdef8

Please sign in to comment.