This repository was archived by the owner on Jun 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Make it possible to specify custom mime types for taste #365
Copy link
Copy link
Open
Description
I'm currently making static sites to download apps via msix. Cause the windows10 app installer needs specialized mime types I need a way to specify them for easier testing.
Proposed solution:
Similar approach like dotnet-serve does:
Add command line parameters that accept mime types with extention.
Second option would be a mime-type list in _config.yml to specify them permanently for the project.
Maybe we could provide both options.
Technically it's an easy change:
AspNetCoreWebHost.cs
var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings[".appx"] = "application/appx";
contentTypeProvider.Mappings[".msix"] = "application/msix";
contentTypeProvider.Mappings[".appxbundle"] = "application/appxbundle";
contentTypeProvider.Mappings[".msixbundle"] = "application/msixbundle";
contentTypeProvider.Mappings[".appinstaller"] = "application/appinstaller";
webHost = WebHost.CreateDefaultBuilder()
.ConfigureLogging(l =>
{
if (!Debug) l.ClearProviders();
})
.ConfigureKestrel(k => k.ListenLocalhost(Port))
.Configure(config => config.UseDefaultFiles().UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = contentTypeProvider
}))
.UseWebRoot(BasePath).Build();Metadata
Metadata
Assignees
Labels
No labels