[Modify] Polish it

This commit is contained in:
sta 2020-09-07 21:20:25 +09:00
parent 8ff8b1d4c4
commit 2bfaa0422c

View File

@ -174,23 +174,23 @@ namespace WebSocketSharp.Net
throw new ArgumentException (msg, "uriPrefix");
}
var startHost = uriPrefix.IndexOf (':') + 3;
var host = uriPrefix.IndexOf (':') + 3;
if (startHost >= len) {
if (host >= len) {
var msg = "No host is specified.";
throw new ArgumentException (msg, "uriPrefix");
}
if (uriPrefix[startHost] == ':') {
if (uriPrefix[host] == ':') {
var msg = "No host is specified.";
throw new ArgumentException (msg, "uriPrefix");
}
var root = uriPrefix.IndexOf ('/', startHost, len - startHost);
var root = uriPrefix.IndexOf ('/', host, len - host);
if (root == startHost) {
if (root == host) {
var msg = "No host is specified.";
throw new ArgumentException (msg, "uriPrefix");