mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
[SG-497] Prevent registering health check on self hosted (#3058)
* Prevent registering health check on self hosted * Fixed linting issues * Allow endpoint only when it is not self-hosted * Fixed linting issues
This commit is contained in:
@ -136,7 +136,10 @@ public class Startup
|
||||
services.AddCoreLocalizationServices();
|
||||
|
||||
//health check
|
||||
services.AddHealthChecks(globalSettings);
|
||||
if (!globalSettings.SelfHosted)
|
||||
{
|
||||
services.AddHealthChecks(globalSettings);
|
||||
}
|
||||
|
||||
#if OSS
|
||||
services.AddOosServices();
|
||||
@ -215,12 +218,15 @@ public class Startup
|
||||
{
|
||||
endpoints.MapDefaultControllerRoute();
|
||||
|
||||
endpoints.MapHealthChecks("/healthz");
|
||||
|
||||
endpoints.MapHealthChecks("/healthz/extended", new HealthCheckOptions
|
||||
if (!globalSettings.SelfHosted)
|
||||
{
|
||||
ResponseWriter = HealthCheckServiceExtensions.WriteResponse
|
||||
});
|
||||
endpoints.MapHealthChecks("/healthz");
|
||||
|
||||
endpoints.MapHealthChecks("/healthz/extended", new HealthCheckOptions
|
||||
{
|
||||
ResponseWriter = HealthCheckServiceExtensions.WriteResponse
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Add Swagger
|
||||
|
Reference in New Issue
Block a user