Merge pull request #670 from pmelanson/653-check-before-brackets-around-ipv6

IPv6 address literals won't be surrounded by [ ... ] if it's already there
paste-quickfix
Lorenz Hübschle-Schneider 10 years ago
commit b327123f48
  1. 2
      js/connection.js

@ -20,7 +20,7 @@ weechat.factory('connection',
connectionData = [host, port, passwd, ssl, noCompression];
var proto = ssl ? 'wss' : 'ws';
// 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 + "]";
}
var url = proto + "://" + host + ":" + port + "/weechat";

Loading…
Cancel
Save