mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
upgrade to aspnet core 3.1
This commit is contained in:
@ -33,12 +33,17 @@ namespace Bit.Server
|
||||
{
|
||||
if(configuration.GetValue<bool?>("serveUnknown") ?? false)
|
||||
{
|
||||
app.Map("/alive", HandleMapAlive);
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
ServeUnknownFileTypes = true,
|
||||
DefaultContentType = "application/octet-stream"
|
||||
});
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGet("/alive",
|
||||
async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||
});
|
||||
}
|
||||
else if(configuration.GetValue<bool?>("webVault") ?? false)
|
||||
{
|
||||
@ -71,14 +76,14 @@ namespace Bit.Server
|
||||
}
|
||||
else
|
||||
{
|
||||
app.Map("/alive", HandleMapAlive);
|
||||
app.UseFileServer();
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGet("/alive",
|
||||
async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleMapAlive(IApplicationBuilder app)
|
||||
{
|
||||
app.Run(async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user