Skip to content

Commit 5d4e6d3

Browse files
authored
Remove reflection from KestrelServer constructor (#50272)
1 parent 78708d6 commit 5d4e6d3

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Servers/Kestrel/Core/src/KestrelServer.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public KestrelServer(IOptions<KestrelServerOptions> options, IConnectionListener
3434
options,
3535
new[] { transportFactory ?? throw new ArgumentNullException(nameof(transportFactory)) },
3636
Array.Empty<IMultiplexedConnectionListenerFactory>(),
37-
new SimpleHttpsConfigurationService(loggerFactory),
37+
new SimpleHttpsConfigurationService(),
3838
loggerFactory,
3939
new KestrelMetrics(new DummyMeterFactory()));
4040
}
@@ -77,13 +77,6 @@ public void Dispose() { }
7777

7878
private sealed class SimpleHttpsConfigurationService : IHttpsConfigurationService
7979
{
80-
private readonly ILogger<HttpsConnectionMiddleware> _httpsLogger;
81-
82-
public SimpleHttpsConfigurationService(ILoggerFactory loggerFactory)
83-
{
84-
_httpsLogger = loggerFactory.CreateLogger<HttpsConnectionMiddleware>();
85-
}
86-
8780
public bool IsInitialized => true;
8881

8982
public void Initialize(IHostEnvironment hostEnvironment, ILogger<KestrelServer> serverLogger, ILogger<HttpsConnectionMiddleware> httpsLogger)
@@ -93,7 +86,7 @@ public void Initialize(IHostEnvironment hostEnvironment, ILogger<KestrelServer>
9386

9487
public void PopulateMultiplexedTransportFeatures(FeatureCollection features, ListenOptions listenOptions)
9588
{
96-
HttpsConfigurationService.PopulateMultiplexedTransportFeaturesWorker(features, listenOptions, _httpsLogger);
89+
throw new NotImplementedException(); // Not actually required by this impl, which never provides an IMultiplexedConnectionListenerFactory
9790
}
9891

9992
public ListenOptions UseHttpsWithDefaults(ListenOptions listenOptions)

0 commit comments

Comments
 (0)