diff --git a/src/Microsoft.AspNetCore.Http.Connections/Internal/Transports/WebSocketsTransport.cs b/src/Microsoft.AspNetCore.Http.Connections/Internal/Transports/WebSocketsTransport.cs index 902f4a9d7d..3632e29c52 100644 --- a/src/Microsoft.AspNetCore.Http.Connections/Internal/Transports/WebSocketsTransport.cs +++ b/src/Microsoft.AspNetCore.Http.Connections/Internal/Transports/WebSocketsTransport.cs @@ -182,7 +182,10 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal.Transports } } } - catch (WebSocketException ex) when (ex.ErrorCode == 997) + catch (WebSocketException ex) when ( + ex.ErrorCode == 997 || + // Sometimes this error is raised without the ErrorCode + ex.Message == "The remote party closed the WebSocket connection without completing the close handshake.") { // The remote party closed the WebSocket connection without completing the close handshake // Don't long an error for this exception