From fb1e0cdd044d5cb057916ceda74e451c1d729917 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 18 Jan 2019 22:16:55 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index b6455578..999a7939 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -717,14 +717,12 @@ namespace WebSocketSharp.Net } else if (requestUri.MaybeUri ()) { Uri uri; - var valid = Uri.TryCreate (requestUri, UriKind.Absolute, out uri) - && ( - ( - (schm = uri.Scheme).StartsWith ("http") - && !websocketRequest - ) - || (schm.StartsWith ("ws") && websocketRequest) - ); + if (!Uri.TryCreate (requestUri, UriKind.Absolute, out uri)) + return null; + + schm = uri.Scheme; + var valid = (schm.StartsWith ("http") && !websocketRequest) + || (schm.StartsWith ("ws") && websocketRequest); if (!valid) return null;