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;