diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 7e2b444b..445ace28 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -878,12 +878,12 @@ namespace WebSocketSharp } if (!customCheckHandshakeRequest (_context, out msg)) { + _logger.Error (msg); + var res = createHandshakeFailureResponse (HttpStatusCode.BadRequest); sendHttpResponse (res); - _logger.Fatal (msg); - - msg = "A fatal error has occurred while attempting to accept."; + msg = "A handshake error has occurred while attempting to accept."; fatal (msg, CloseStatusCode.PolicyViolation); return false;