From 8181b5c7d1b374c537d26e5b66b98d6f0cc79640 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 6 Jun 2023 11:36:43 +0800 Subject: [PATCH] Minor debugging visualizer cleanup --- src/Http/Http.Abstractions/src/ConnectionInfo.cs | 8 +++++++- src/Http/Http.Abstractions/src/WebSocketManager.cs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Http/Http.Abstractions/src/ConnectionInfo.cs b/src/Http/Http.Abstractions/src/ConnectionInfo.cs index eb63133a4b9a..41a407836554 100644 --- a/src/Http/Http.Abstractions/src/ConnectionInfo.cs +++ b/src/Http/Http.Abstractions/src/ConnectionInfo.cs @@ -64,7 +64,13 @@ private string DebuggerToString() { var remoteEndpoint = RemoteIpAddress == null ? "(null)" : new IPEndPoint(RemoteIpAddress, RemotePort).ToString(); var localEndpoint = LocalIpAddress == null ? "(null)" : new IPEndPoint(LocalIpAddress, LocalPort).ToString(); - return $"Id = {Id ?? "(null)"}, Remote = {remoteEndpoint}, Local = {localEndpoint}, ClientCertificate = {ClientCertificate?.Subject ?? "(null)"}"; + + var s = $"Id = {Id ?? "(null)"}, Remote = {remoteEndpoint}, Local = {localEndpoint}"; + if (ClientCertificate != null) + { + s += $", ClientCertificate = {ClientCertificate.Subject}"; + } + return s; } private sealed class ConnectionInfoDebugView(ConnectionInfo info) diff --git a/src/Http/Http.Abstractions/src/WebSocketManager.cs b/src/Http/Http.Abstractions/src/WebSocketManager.cs index d927c3f04d9c..335028183906 100644 --- a/src/Http/Http.Abstractions/src/WebSocketManager.cs +++ b/src/Http/Http.Abstractions/src/WebSocketManager.cs @@ -50,8 +50,8 @@ private string DebuggerToString() { return IsWebSocketRequest switch { - false => "IsWebSocketRequest = False", - true => $"IsWebSocketRequest = True, RequestedProtocols = {string.Join(",", WebSocketRequestedProtocols)}", + false => "IsWebSocketRequest = false", + true => $"IsWebSocketRequest = true, RequestedProtocols = {string.Join(",", WebSocketRequestedProtocols)}", }; }