Просмотр исходного кода

Fix typo in kestrel sample startup (#32806)

avparuch 4 лет назад
Родитель
Сommit
1a55677a12
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/Servers/Kestrel/samples/SampleApp/Startup.cs

+ 3 - 2
src/Servers/Kestrel/samples/SampleApp/Startup.cs

@@ -116,9 +116,10 @@ namespace SampleApp
                                 listenOptions.UseHttps((stream, clientHelloInfo, state, cancellationToken) =>
                                 {
                                     // Here you would check the name, select an appropriate cert, and provide a fallback or fail for null names.
-                                    if (clientHelloInfo.ServerName != null && clientHelloInfo.ServerName != "localhost")
+                                    var serverName = clientHelloInfo.ServerName;
+                                    if (serverName != null && serverName != "localhost")
                                     {
-                                        throw new AuthenticationException($"The endpoint is not configured for sever name '{clientHelloInfo.ServerName}'.");
+                                        throw new AuthenticationException($"The endpoint is not configured for server name '{clientHelloInfo.ServerName}'.");
                                     }
 
                                     return new ValueTask<SslServerAuthenticationOptions>(new SslServerAuthenticationOptions