mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-18 21:20:39 +01:00
lint
This commit is contained in:
parent
f67abf9e03
commit
f27b3361e5
@ -289,11 +289,11 @@ if (dnsPreferIPv6) {
|
||||
const ipOptions = [true, 'auto', false];
|
||||
|
||||
if (!ipOptions.includes(enableIPv6)) {
|
||||
console.warn(color.red('`protocol: ipv6` option invalid'), "\n use:", ipOptions, "\n setting to: auto");
|
||||
console.warn(color.red('`protocol: ipv6` option invalid'), '\n use:', ipOptions, '\n setting to: auto');
|
||||
enableIPv6 = 'auto';
|
||||
}
|
||||
if (!ipOptions.includes(enableIPv4)) {
|
||||
console.warn(color.red('`protocol: ipv4` option invalid'), "\n use:", ipOptions, "\n setting to: auto");
|
||||
console.warn(color.red('`protocol: ipv4` option invalid'), '\n use:', ipOptions, '\n setting to: auto');
|
||||
enableIPv4 = 'auto';
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ function createHttpsServer(url, ipVersion) {
|
||||
server.on('error', reject);
|
||||
server.on('listening', resolve);
|
||||
|
||||
let host = url.hostname
|
||||
let host = url.hostname;
|
||||
if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname);
|
||||
server.listen({
|
||||
host: host,
|
||||
@ -910,7 +910,7 @@ function createHttpServer(url, ipVersion) {
|
||||
server.on('error', reject);
|
||||
server.on('listening', resolve);
|
||||
|
||||
let host = url.hostname
|
||||
let host = url.hostname;
|
||||
if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname);
|
||||
server.listen({
|
||||
host: host,
|
||||
|
@ -693,13 +693,13 @@ export function isValidUrl(url) {
|
||||
}
|
||||
|
||||
export function urlHostnameToIPv6(hostname) {
|
||||
if (hostname.startsWith("[")) {
|
||||
if (hostname.startsWith('[')) {
|
||||
hostname = hostname.slice(1);
|
||||
}
|
||||
if (hostname.endsWith("]")) {
|
||||
if (hostname.endsWith(']')) {
|
||||
hostname = hostname.slice(0, -1);
|
||||
}
|
||||
return hostname
|
||||
return hostname;
|
||||
}
|
||||
|
||||
export function stringToBool(str) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user