From e8a558632c67eed6d30a70baed8d4efcc9558824 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sun, 20 Nov 2022 17:55:34 +0100 Subject: [PATCH] Code cleanup --- Startup.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Startup.cs b/Startup.cs index 41e0114..92988dc 100644 --- a/Startup.cs +++ b/Startup.cs @@ -23,10 +23,6 @@ namespace webmusic { // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public static void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - var provider = new FileExtensionContentTypeProvider(); - provider.Mappings[".flac"] = "audio/flac"; - provider.Mappings[".m3u"] = "audio/m3u"; - provider.Mappings[".opus"] = "audio/opus"; if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } @@ -36,10 +32,11 @@ namespace webmusic { app.UseHsts(); } - app.UseStaticFiles(new StaticFileOptions {ContentTypeProvider = provider}); + var provider = new FileExtensionContentTypeProvider { Mappings = { [".flac"] = "audio/flac", [".m3u"] = "audio/m3u", [".opus"] = "audio/opus" } }; + app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = provider }); app.UseCookiePolicy(); app.UseMvc(); } } -} \ No newline at end of file +}