- Enable .NET applications to serve static files which have been compressed via gzipand/orbrotli
 compression algorithms, correctly mapping their original file's content-types and response headers.
- Allow user to extend the Options Class to add additional compression types and configure mappings.
- Leverage the package's static usingdirective*
- Call the package's GetOptionsmethod as the argument toUseStaticFiles(...)*
 this will pass the extendedStaticFileOptionswhile building the request pipeline.
using static CWDev.StaticFileOptionsExtender;      // <-- *
var builder = WebApplication.CreateBuilder(args);
// ...
var app = builder.Build();
// ...
app.UseStaticFiles(GetOptions());                  // <-- *.NET WebApplicationBuilder can be leveraged to configure the application HTTP Request Pipeline. 
Within that Pipeline StaticFileMiddleware can be used to serve static files. 
Typically, the app.UseStaticFiles(StaticFileOptions options) middleware configures a few key 
steps. This library is mostly concerned with TWO -- Providers and Handlers -- regarding:
- Mapping files content-types:- IContentTypeProvider StaticFileOptions.ContentTypeProvider*
 
- Adding or changing the response headers:
- Action<StaticFileResponseContext> StaticFileOptions.OnPrepareResponse*
 
StaticFileOptions StaticFileOptionsExtender.GetOptions
public static StaticFileOptions GetOptions()
{
    var customFileTypeProvider = new CustomContentTypeProvider();
    return new StaticFileOptions
    {
        ContentTypeProvider = customFileTypeProvider,                // <-- *
        OnPrepareResponse = (StaticFileResponseContext context) =>   // <-- *
        {
            if (CompressionEncodings.TryGetValue(Path.GetExtension(context.File.Name), out string? encoding))
            {
                context.Context.Response.Headers.ContentEncoding = encoding;
            }
        }
    };
}Specifically, StaticFileOptionsExtender leverages a class inheriting from IContentTypeProvider 
to extend the MIME type mappings for the 380 most commonly used file types (default). 
This library originally was built to enable .NET to serve static files which have been compressed for WebGL 
by building from Unity.
- CHANGELOG
- The format is based on Keep a Changelog and this project adheres to Semantic Versioning
- Commits follow Conventional Commits patterns
 
- Please open a GitHub Issue with concerns.
- Open a PR if you have a code proposal.
- I will respond in <=24hours with thoughts and/or solution.