fix condition

This commit is contained in:
Ildar Kamalov 2019-08-22 18:50:58 +03:00
parent 0bd722c426
commit c8052c23d1
1 changed files with 3 additions and 3 deletions

View File

@ -139,10 +139,10 @@ export const getWebAddress = (ip, port = '') => {
const isStandardWebPort = port === STANDARD_WEB_PORT;
let address = `http://${ip}`;
if (port) {
if (ip.includes(':') && !ip.includes('[') && !isStandardWebPort) {
if (port && !isStandardWebPort) {
if (ip.includes(':') && !ip.includes('[')) {
address = `http://[${ip}]:${port}`;
} else if (!isStandardWebPort) {
} else {
address = `http://${ip}:${port}`;
}
}