fix: ELECTRON_RENDERER_URL is incorrect

This commit is contained in:
xiaohui
2022-06-20 00:38:05 +08:00
parent c71d5aa661
commit c568348fc9
2 changed files with 8 additions and 2 deletions

View File

@@ -37,3 +37,9 @@ export function getElectronPath(): string {
throw new Error('Electron uninstall')
}
}
export const wildcardHosts = new Set(['0.0.0.0', '::', '0000:0000:0000:0000:0000:0000:0000:0000'])
export function resolveHostname(optionsHost: string | boolean | undefined): string {
return typeof optionsHost === 'string' && !wildcardHosts.has(optionsHost) ? optionsHost : 'localhost'
}