From e19035ffeb112bda4207c6602a1a2ca0315a1d41 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 14 Feb 2022 21:21:23 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Ext.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 96dfdaff..a55151d0 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -162,9 +162,6 @@ namespace WebSocketSharp private static bool isPredefinedScheme (this string value) { - if (value.Length < 2) - return false; - var c = value[0]; if (c == 'h') @@ -750,10 +747,7 @@ namespace WebSocketSharp { var idx = value.IndexOf (':'); - if (idx == -1) - return false; - - if (idx >= 10) + if (idx < 2 || idx > 9) return false; var schm = value.Substring (0, idx);