From 8478bfd9ba6f2fcf7aa0b869b13ad90113281f94 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 12 Aug 2016 16:10:58 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/WebSocket.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 4aebd11f..49c1194e 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -841,6 +841,31 @@ namespace WebSocketSharp return checkIfAvailable (connecting, open, closing, closed, out message); } + private static bool checkParametersForSetCredentials ( + string username, string password, out string message + ) + { + message = null; + + if (username.IsNullOrEmpty ()) + return true; + + if (username.Contains (':') || !username.IsText ()) { + message = "'username' contains an invalid character."; + return false; + } + + if (password.IsNullOrEmpty ()) + return true; + + if (!password.IsText ()) { + message = "'password' contains an invalid character."; + return false; + } + + return true; + } + private bool checkReceivedFrame (WebSocketFrame frame, out string message) { message = null;