[Modify] Add it

This commit is contained in:
sta 2017-09-28 17:39:45 +09:00
parent 2dae0a101b
commit 041663623a

View File

@ -942,6 +942,29 @@ namespace WebSocketSharp
return true;
}
private static bool checkProtocols (string[] protocols, out string message)
{
message = null;
var invalid = protocols.Contains (
protocol => protocol == null
|| protocol.Length == 0
|| !protocol.IsToken ()
);
if (invalid) {
message = "It contains an invalid value.";
return false;
}
if (protocols.ContainsTwice ()) {
message = "It contains a value twice.";
return false;
}
return true;
}
private bool checkReceivedFrame (WebSocketFrame frame, out string message)
{
message = null;