Pass CancellationToken from StreamConnectAsync to webSocketBuilder.BuildAndConnectAsync (#1504)

This commit is contained in:
Nathan Willoughby
2024-01-22 18:12:20 +10:00
committed by GitHub
parent b27033a867
commit 465c1fdca2

View File

@@ -281,8 +281,7 @@ namespace k8s
try
{
BeforeRequest();
webSocket = await webSocketBuilder.BuildAndConnectAsync(uri, CancellationToken.None)
.ConfigureAwait(false);
webSocket = await webSocketBuilder.BuildAndConnectAsync(uri, cancellationToken).ConfigureAwait(false);
}
catch (WebSocketException wse) when (wse.WebSocketErrorCode == WebSocketError.HeaderError ||
(wse.InnerException is WebSocketException &&