From 643278478f9ce2ac4a9c737bed6dc2233fbc2502 Mon Sep 17 00:00:00 2001 From: pmelanson Date: Fri, 13 Nov 2015 20:56:43 +0000 Subject: [PATCH] IPv6 address literals won't be surrounded by [ ... ] if it's already there --- js/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/connection.js b/js/connection.js index c6a60c9..b39027f 100644 --- a/js/connection.js +++ b/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";