Skip to content

Commit

Permalink
Fix WebSocketCloseReason for suppressed error (#1920)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher committed Nov 2, 2022
1 parent 5c2af7f commit 4015fa7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public WebSocketCloseReason GetCloseReason(HttpContext context)
ForwarderError.UpgradeRequestDestination => WebSocketCloseReason.ServerDisconnect,
ForwarderError.UpgradeResponseDestination => WebSocketCloseReason.ServerDisconnect,

// Both sides gracefully closed the underlying connection without sending a WebSocket close
// Neither side is doing what we recognize as WebSockets ¯\_(ツ)_/¯
null => WebSocketCloseReason.Unknown,
// Both sides gracefully closed the underlying connection without sending a WebSocket close,
// or the server closed the connection and we canceled the client and suppressed the errors.
null => WebSocketCloseReason.ServerDisconnect,

// We are not expecting any other error from HttpForwarder after a successful connection upgrade
// Technically, a user could overwrite the IForwarderErrorFeature, in which case we don't know what's going on
Expand Down

0 comments on commit 4015fa7

Please sign in to comment.