improved urlHostnameToIPv6

f67abf9e037b7dc3ccee90299f7fba2a94854135

BPplays <andymalbp@gmail.com>

1 files changed, +2 -2Ignore whitespace
src/util.js+2 -2
@@ -693,10 +693,10 @@ export function isValidUrl(url) {
693}693}
694694
695export function urlHostnameToIPv6(hostname) {695export function urlHostnameToIPv6(hostname) {
696 if (hostname.charAt(0) === '[') {696 if (hostname.startsWith("[")) {
697 hostname = hostname.slice(1);697 hostname = hostname.slice(1);
698 }698 }
699 if (hostname.charAt(hostname.length - 1) === ']') {699 if (hostname.endsWith("]")) {
700 hostname = hostname.slice(0, -1);700 hostname = hostname.slice(0, -1);
701 }701 }
702 return hostname702 return hostname