From c6e1c936b25a985a1af48b15a66745a657a43514 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 15 Jan 2021 21:55:54 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 407c1cad..90461d07 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -711,6 +711,7 @@ namespace WebSocketSharp.Net } else if (requestUri.MaybeUri ()) { Uri uri; + if (!Uri.TryCreate (requestUri, UriKind.Absolute, out uri)) return null; @@ -729,6 +730,7 @@ namespace WebSocketSharp.Net } else { // As the authority form. + host = requestUri; } @@ -742,8 +744,8 @@ namespace WebSocketSharp.Net host = String.Format ("{0}:{1}", host, secure ? 443 : 80); var url = String.Format ("{0}://{1}{2}", schm, host, path); - Uri ret; + return Uri.TryCreate (url, UriKind.Absolute, out ret) ? ret : null; }