lint
| @@ -289,11 +289,11 @@ if (dnsPreferIPv6) { | |||
| 289 | const ipOptions = [true, 'auto', false]; | 289 | const ipOptions = [true, 'auto', false]; |
| 290 | 290 | ||
| 291 | if (!ipOptions.includes(enableIPv6)) { | 291 | if (!ipOptions.includes(enableIPv6)) { |
| 292 | console.warn(color.red('`protocol: ipv6` option invalid'), "\n use:", ipOptions, "\n setting to: auto"); | 292 | console.warn(color.red('`protocol: ipv6` option invalid'), '\n use:', ipOptions, '\n setting to: auto'); |
| 293 | enableIPv6 = 'auto'; | 293 | enableIPv6 = 'auto'; |
| 294 | } | 294 | } |
| 295 | if (!ipOptions.includes(enableIPv4)) { | 295 | if (!ipOptions.includes(enableIPv4)) { |
| 296 | console.warn(color.red('`protocol: ipv4` option invalid'), "\n use:", ipOptions, "\n setting to: auto"); | 296 | console.warn(color.red('`protocol: ipv4` option invalid'), '\n use:', ipOptions, '\n setting to: auto'); |
| 297 | enableIPv4 = 'auto'; | 297 | enableIPv4 = 'auto'; |
| 298 | } | 298 | } |
| 299 | 299 | ||
| @@ -887,7 +887,7 @@ function createHttpsServer(url, ipVersion) { | |||
| 887 | server.on('error', reject); | 887 | server.on('error', reject); |
| 888 | server.on('listening', resolve); | 888 | server.on('listening', resolve); |
| 889 | 889 | ||
| 890 | let host = url.hostname | 890 | let host = url.hostname; |
| 891 | if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname); | 891 | if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname); |
| 892 | server.listen({ | 892 | server.listen({ |
| 893 | host: host, | 893 | host: host, |
| @@ -910,7 +910,7 @@ function createHttpServer(url, ipVersion) { | |||
| 910 | server.on('error', reject); | 910 | server.on('error', reject); |
| 911 | server.on('listening', resolve); | 911 | server.on('listening', resolve); |
| 912 | 912 | ||
| 913 | let host = url.hostname | 913 | let host = url.hostname; |
| 914 | if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname); | 914 | if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname); |
| 915 | server.listen({ | 915 | server.listen({ |
| 916 | host: host, | 916 | host: host, |
| @@ -693,13 +693,13 @@ export function isValidUrl(url) { | |||
| 693 | } | 693 | } |
| 694 | 694 | ||
| 695 | export function urlHostnameToIPv6(hostname) { | 695 | export function urlHostnameToIPv6(hostname) { |
| 696 | if (hostname.startsWith("[")) { | 696 | if (hostname.startsWith('[')) { |
| 697 | hostname = hostname.slice(1); | 697 | hostname = hostname.slice(1); |
| 698 | } | 698 | } |
| 699 | if (hostname.endsWith("]")) { | 699 | if (hostname.endsWith(']')) { |
| 700 | hostname = hostname.slice(0, -1); | 700 | hostname = hostname.slice(0, -1); |
| 701 | } | 701 | } |
| 702 | return hostname | 702 | return hostname; |
| 703 | } | 703 | } |
| 704 | 704 | ||
| 705 | export function stringToBool(str) { | 705 | export function stringToBool(str) { |