From 1cf3c988a9c2a993202e1411b857b472e3556896 Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 19 Jan 2019 22:24:32 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 999a7939..a43680d1 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -721,8 +721,9 @@ namespace WebSocketSharp.Net return null; schm = uri.Scheme; - var valid = (schm.StartsWith ("http") && !websocketRequest) - || (schm.StartsWith ("ws") && websocketRequest); + var valid = websocketRequest + ? schm == "ws" || schm == "wss" + : schm == "http" || schm == "https"; if (!valid) return null;