IPv6 address literals won't be surrounded by [ ... ] if it's already there
This commit is contained in:
parent
8a7a173cb7
commit
643278478f
|
@ -20,7 +20,7 @@ weechat.factory('connection',
|
||||||
connectionData = [host, port, passwd, ssl, noCompression];
|
connectionData = [host, port, passwd, ssl, noCompression];
|
||||||
var proto = ssl ? 'wss' : 'ws';
|
var proto = ssl ? 'wss' : 'ws';
|
||||||
// If host is an IPv6 literal wrap it in brackets
|
// If host is an IPv6 literal wrap it in brackets
|
||||||
if (host.indexOf(":") !== -1) {
|
if (host.indexOf(":") !== -1 && host[0] !== "[" && host[host.length-1] !== "]") {
|
||||||
host = "[" + host + "]";
|
host = "[" + host + "]";
|
||||||
}
|
}
|
||||||
var url = proto + "://" + host + ":" + port + "/weechat";
|
var url = proto + "://" + host + ":" + port + "/weechat";
|
||||||
|
|
Loading…
Reference in New Issue