소스 검색

Fix typo in kestrel sample startup (#32806)

avparuch 4 년 전
부모
커밋
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) =>
                                 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.
                                     // 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
                                     return new ValueTask<SslServerAuthenticationOptions>(new SslServerAuthenticationOptions