[Modify] Polish it

This commit is contained in:
sta 2020-09-12 22:09:48 +09:00
parent a0cafe5b40
commit d3085f0c4b

View File

@ -133,6 +133,7 @@ namespace WebSocketSharp.Net
var root = uriPrefix.IndexOf ('/', startHost + 1, len - startHost - 1); var root = uriPrefix.IndexOf ('/', startHost + 1, len - startHost - 1);
var colon = uriPrefix.LastIndexOf (':', root - 1, root - startHost - 1); var colon = uriPrefix.LastIndexOf (':', root - 1, root - startHost - 1);
if (uriPrefix[root - 1] != ']' && colon > startHost) { if (uriPrefix[root - 1] != ']' && colon > startHost) {
_host = uriPrefix.Substring (startHost, colon - startHost); _host = uriPrefix.Substring (startHost, colon - startHost);
_port = uriPrefix.Substring (colon + 1, root - colon - 1); _port = uriPrefix.Substring (colon + 1, root - colon - 1);
@ -144,8 +145,13 @@ namespace WebSocketSharp.Net
_path = uriPrefix.Substring (root); _path = uriPrefix.Substring (root);
_prefix = _prefix = String.Format (
String.Format ("http{0}://{1}:{2}{3}", _secure ? "s" : "", _host, _port, _path); "http{0}://{1}:{2}{3}",
_secure ? "s" : "",
_host,
_port,
_path
);
} }
#endregion #endregion