Skip to content

Commit 8526b21

Browse files
committed
Don't pass the full settings object in
1 parent 59dd484 commit 8526b21

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/ServiceControl/Hosting/Commands/RunCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public override async Task Execute(HostArguments args, Settings settings)
3030
hostBuilder.AddServiceControlApi(settings);
3131

3232
var app = hostBuilder.Build();
33-
app.UseServiceControl(settings.ForwardedHeadersSettings, settings.HttpsSettings, settings);
33+
app.UseServiceControl(settings.ForwardedHeadersSettings, settings.HttpsSettings, settings.EnableMcpServer);
3434
if (settings.EnableIntegratedServicePulse)
3535
{
3636
app.UseServicePulse(settings.ServicePulseSettings);

src/ServiceControl/WebApplicationExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ namespace ServiceControl;
33
using Infrastructure.SignalR;
44
using Infrastructure.WebApi;
55
using Microsoft.AspNetCore.Builder;
6-
using ServiceBus.Management.Infrastructure.Settings;
76
using ServiceControl.Hosting.ForwardedHeaders;
87
using ServiceControl.Hosting.Https;
98
using ServiceControl.Infrastructure;
109

1110
public static class WebApplicationExtensions
1211
{
13-
public static void UseServiceControl(this WebApplication app, ForwardedHeadersSettings forwardedHeadersSettings, HttpsSettings httpsSettings, Settings settings)
12+
public static void UseServiceControl(this WebApplication app, ForwardedHeadersSettings forwardedHeadersSettings, HttpsSettings httpsSettings, bool enableMcpServer)
1413
{
1514
app.UseServiceControlForwardedHeaders(forwardedHeadersSettings);
1615
app.UseServiceControlHttps(httpsSettings);
@@ -21,7 +20,7 @@ public static void UseServiceControl(this WebApplication app, ForwardedHeadersSe
2120
app.UseCors();
2221
app.MapControllers();
2322

24-
if (settings.EnableMcpServer)
23+
if (enableMcpServer)
2524
{
2625
app.MapMcp();
2726
}

0 commit comments

Comments
 (0)