diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index 595bf6af..f53f4d6a 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -608,13 +608,16 @@ namespace WebSocketSharp.Server /// public bool TryGetServiceHost (string path, out WebSocketServiceHost host) { - var msg = _state.CheckIfAvailable (false, true, false) ?? path.CheckIfValidServicePath (); - if (msg != null) { - _logger.Error (msg); - host = null; + host = null; + if (path == null || path.Length == 0) + return false; + + if (path[0] != '/') + return false; + + if (path.IndexOfAny (new[] { '?', '#' }) > -1) return false; - } return InternalTryGetServiceHost (path, out host); }