mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-18 21:20:39 +01:00
improved urlHostnameToIPv6
This commit is contained in:
parent
7744be3319
commit
f67abf9e03
@ -693,10 +693,10 @@ export function isValidUrl(url) {
|
||||
}
|
||||
|
||||
export function urlHostnameToIPv6(hostname) {
|
||||
if (hostname.charAt(0) === '[') {
|
||||
if (hostname.startsWith("[")) {
|
||||
hostname = hostname.slice(1);
|
||||
}
|
||||
if (hostname.charAt(hostname.length - 1) === ']') {
|
||||
if (hostname.endsWith("]")) {
|
||||
hostname = hostname.slice(0, -1);
|
||||
}
|
||||
return hostname
|
||||
|
Loading…
x
Reference in New Issue
Block a user