[Modify] Polish it
This commit is contained in:
parent
8614a891f0
commit
47dfbe62df
@ -608,13 +608,16 @@ namespace WebSocketSharp.Server
|
||||
/// </param>
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user