From 98f477ab089fc083cb43b6f5fb521633ed6d3d29 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 6 Oct 2021 19:34:34 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Server/WebSocketServiceManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index 4f192759..985821b0 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -156,15 +156,20 @@ namespace WebSocketSharp.Server if (path.Length == 0) throw new ArgumentException ("An empty string.", "path"); - if (path[0] != '/') - throw new ArgumentException ("Not an absolute path.", "path"); + if (path[0] != '/') { + var msg = "It is not an absolute path."; + + throw new ArgumentException (msg, "path"); + } if (path.IndexOfAny (new[] { '?', '#' }) > -1) { var msg = "It includes either or both query and fragment components."; + throw new ArgumentException (msg, "path"); } WebSocketServiceHost host; + InternalTryGetServiceHost (path, out host); return host;