From 7ed4bb34e34ed62d5f3dbe1e351fe9ac216d1f17 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 22 Sep 2021 19:26:18 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Server/WebSocketServiceManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index 57ff84a3..acc16f5e 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -514,8 +514,11 @@ namespace WebSocketSharp.Server if (path.Length == 0) throw new ArgumentException ("An empty string.", "path"); - if (path[0] != '/') - throw new ArgumentException ("It is 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.";