mirror of
https://github.com/bitwarden/server
synced 2025-12-18 17:23:28 +00:00
Changed all C# control flow block statements to include space between keyword and open paren
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Bit.Api
|
||||
|
||||
// Settings
|
||||
var globalSettings = services.AddGlobalSettingsServices(Configuration);
|
||||
if(!globalSettings.SelfHosted)
|
||||
if (!globalSettings.SelfHosted)
|
||||
{
|
||||
services.Configure<IpRateLimitOptions>(Configuration.GetSection("IpRateLimitOptions"));
|
||||
services.Configure<IpRateLimitPolicies>(Configuration.GetSection("IpRateLimitPolicies"));
|
||||
@@ -64,7 +64,7 @@ namespace Bit.Api
|
||||
// BitPay
|
||||
services.AddSingleton<BitPayClient>();
|
||||
|
||||
if(!globalSettings.SelfHosted)
|
||||
if (!globalSettings.SelfHosted)
|
||||
{
|
||||
// Rate limiting
|
||||
services.AddSingleton<IIpPolicyStore, MemoryCacheIpPolicyStore>();
|
||||
@@ -118,7 +118,7 @@ namespace Bit.Api
|
||||
config.Conventions.Add(new PublicApiControllersModelConvention());
|
||||
}).AddNewtonsoftJson(options =>
|
||||
{
|
||||
if(Environment.IsProduction() && Configuration["swaggerGen"] != "true")
|
||||
if (Environment.IsProduction() && Configuration["swaggerGen"] != "true")
|
||||
{
|
||||
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
|
||||
}
|
||||
@@ -126,13 +126,13 @@ namespace Bit.Api
|
||||
|
||||
services.AddSwagger(globalSettings);
|
||||
|
||||
if(globalSettings.SelfHosted)
|
||||
if (globalSettings.SelfHosted)
|
||||
{
|
||||
// Jobs service
|
||||
Jobs.JobsHostedService.AddJobsServices(services);
|
||||
services.AddHostedService<Jobs.JobsHostedService>();
|
||||
}
|
||||
if(CoreHelpers.SettingHasValue(globalSettings.ServiceBus.ConnectionString) &&
|
||||
if (CoreHelpers.SettingHasValue(globalSettings.ServiceBus.ConnectionString) &&
|
||||
CoreHelpers.SettingHasValue(globalSettings.ServiceBus.ApplicationCacheTopicName))
|
||||
{
|
||||
services.AddHostedService<Core.HostedServices.ApplicationCacheHostedService>();
|
||||
@@ -152,7 +152,7 @@ namespace Bit.Api
|
||||
// Default Middleware
|
||||
app.UseDefaultMiddleware(env, globalSettings);
|
||||
|
||||
if(!globalSettings.SelfHosted)
|
||||
if (!globalSettings.SelfHosted)
|
||||
{
|
||||
// Rate limiting
|
||||
app.UseMiddleware<CustomIpRateLimitMiddleware>();
|
||||
@@ -183,7 +183,7 @@ namespace Bit.Api
|
||||
app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute());
|
||||
|
||||
// Add Swagger
|
||||
if(Environment.IsDevelopment() || globalSettings.SelfHosted)
|
||||
if (Environment.IsDevelopment() || globalSettings.SelfHosted)
|
||||
{
|
||||
app.UseSwagger(config =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user