diff --git a/util/Server/Startup.cs b/util/Server/Startup.cs index 546f5b2ece..a32b2ac2c9 100644 --- a/util/Server/Startup.cs +++ b/util/Server/Startup.cs @@ -31,8 +31,7 @@ namespace Bit.Server .AddConsole() .AddDebug(); - var serveUnknown = configuration.GetValue("serveUnknown") ?? false; - if(serveUnknown) + if(configuration.GetValue("serveUnknown") ?? false) { app.UseStaticFiles(new StaticFileOptions { @@ -40,7 +39,7 @@ namespace Bit.Server DefaultContentType = "application/octet-stream" }); } - else + else if(configuration.GetValue("webVault") ?? false) { var options = new DefaultFilesOptions(); options.DefaultFileNames.Clear(); @@ -50,7 +49,8 @@ namespace Bit.Server { OnPrepareResponse = ctx => { - if(!ctx.Context.Request.Path.HasValue) + if(!ctx.Context.Request.Path.HasValue || + ctx.Context.Response.Headers.ContainsKey("Cache-Control")) { return; } @@ -68,6 +68,10 @@ namespace Bit.Server } }); } + else + { + app.UseFileServer(); + } } } }