Remove null check for logger in HttpsConnectionMiddleware (#16736)
This commit is contained in:
parent
271ebe0198
commit
ab5b5a4ab5
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
_options = options;
|
_options = options;
|
||||||
_logger = loggerFactory?.CreateLogger<HttpsConnectionMiddleware>();
|
_logger = loggerFactory.CreateLogger<HttpsConnectionMiddleware>();
|
||||||
}
|
}
|
||||||
public async Task OnConnectionAsync(ConnectionContext context)
|
public async Task OnConnectionAsync(ConnectionContext context)
|
||||||
{
|
{
|
||||||
|
|
@ -201,13 +201,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
_logger?.LogDebug(2, CoreStrings.AuthenticationTimedOut);
|
_logger.LogDebug(2, CoreStrings.AuthenticationTimedOut);
|
||||||
await sslStream.DisposeAsync();
|
await sslStream.DisposeAsync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
_logger?.LogDebug(1, ex, CoreStrings.AuthenticationFailed);
|
_logger.LogDebug(1, ex, CoreStrings.AuthenticationFailed);
|
||||||
await sslStream.DisposeAsync();
|
await sslStream.DisposeAsync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue