[Modify] Polish it

This commit is contained in:
sta 2022-02-14 21:21:23 +09:00
parent 7f1fb159b8
commit e19035ffeb

View File

@ -162,9 +162,6 @@ namespace WebSocketSharp
private static bool isPredefinedScheme (this string value) private static bool isPredefinedScheme (this string value)
{ {
if (value.Length < 2)
return false;
var c = value[0]; var c = value[0];
if (c == 'h') if (c == 'h')
@ -750,10 +747,7 @@ namespace WebSocketSharp
{ {
var idx = value.IndexOf (':'); var idx = value.IndexOf (':');
if (idx == -1) if (idx < 2 || idx > 9)
return false;
if (idx >= 10)
return false; return false;
var schm = value.Substring (0, idx); var schm = value.Substring (0, idx);