[Modify] Polish it
This commit is contained in:
parent
fa70e8d059
commit
cf50e89001
@ -515,10 +515,11 @@ namespace WebSocketSharp.Server
|
|||||||
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");
|
throw new ArgumentException ("It is not an absolute path.", "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");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -526,8 +527,9 @@ namespace WebSocketSharp.Server
|
|||||||
|
|
||||||
lock (_sync) {
|
lock (_sync) {
|
||||||
WebSocketServiceHost host;
|
WebSocketServiceHost host;
|
||||||
|
|
||||||
if (_hosts.TryGetValue (path, out host))
|
if (_hosts.TryGetValue (path, out host))
|
||||||
throw new ArgumentException ("Already in use.", "path");
|
throw new ArgumentException ("It is already in use.", "path");
|
||||||
|
|
||||||
host = new WebSocketServiceHost<TBehavior> (
|
host = new WebSocketServiceHost<TBehavior> (
|
||||||
path, () => new TBehavior (), initializer, _log
|
path, () => new TBehavior (), initializer, _log
|
||||||
|
Loading…
Reference in New Issue
Block a user