Code cleanup

This commit is contained in:
Laura Hausmann 2022-11-20 17:55:34 +01:00
parent 54fe97c2c7
commit e8a558632c
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -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();
}
}
}
}