From 03aad074e65245b2d51a5dc1ae746e08c4c93495 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 12 Aug 2016 16:59:39 +0900 Subject: [PATCH] [Modify] Use it --- websocket-sharp/WebSocket.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 49c1194e..f12dd874 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -2843,20 +2843,11 @@ namespace WebSocketSharp return; } - if (!username.IsNullOrEmpty ()) { - if (username.Contains (':') || !username.IsText ()) { - _logger.Error ("'username' contains an invalid character."); - error ("An error has occurred in setting the credentials.", null); + if (!checkParametersForSetCredentials (username, password, out msg)) { + _logger.Error (msg); + error ("An error has occurred in setting the credentials.", null); - return; - } - - if (!password.IsNullOrEmpty () && !password.IsText ()) { - _logger.Error ("'password' contains an invalid character."); - error ("An error has occurred in setting the credentials.", null); - - return; - } + return; } lock (_forState) {