[Modify] Polish it
This commit is contained in:
parent
c4fd537ad7
commit
98f477ab08
@ -156,15 +156,20 @@ namespace WebSocketSharp.Server
|
|||||||
if (path.Length == 0)
|
if (path.Length == 0)
|
||||||
throw new ArgumentException ("An empty string.", "path");
|
throw new ArgumentException ("An empty string.", "path");
|
||||||
|
|
||||||
if (path[0] != '/')
|
if (path[0] != '/') {
|
||||||
throw new ArgumentException ("Not an absolute path.", "path");
|
var msg = "It is not an absolute path.";
|
||||||
|
|
||||||
|
throw new ArgumentException (msg, "path");
|
||||||
|
}
|
||||||
|
|
||||||
if (path.IndexOfAny (new[] { '?', '#' }) > -1) {
|
if (path.IndexOfAny (new[] { '?', '#' }) > -1) {
|
||||||
var msg = "It includes either or both query and fragment components.";
|
var msg = "It includes either or both query and fragment components.";
|
||||||
|
|
||||||
throw new ArgumentException (msg, "path");
|
throw new ArgumentException (msg, "path");
|
||||||
}
|
}
|
||||||
|
|
||||||
WebSocketServiceHost host;
|
WebSocketServiceHost host;
|
||||||
|
|
||||||
InternalTryGetServiceHost (path, out host);
|
InternalTryGetServiceHost (path, out host);
|
||||||
|
|
||||||
return host;
|
return host;
|
||||||
|
Loading…
Reference in New Issue
Block a user