mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-26 23:28:08 +03:00
Fixed port validation
This commit is contained in:
parent
8e993cd788
commit
158f2f6100
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ export const isPositive = (value) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const port = (value) => {
|
export const port = (value) => {
|
||||||
if (value && (value < 80 || value > 65535)) {
|
if ((value || value === 0) && (value < 80 || value > 65535)) {
|
||||||
return <Trans>form_error_port_range</Trans>;
|
return <Trans>form_error_port_range</Trans>;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -195,7 +195,7 @@ export const redirectToCurrentProtocol = (values, httpPort = 80) => {
|
||||||
|
|
||||||
if (protocol !== 'https:' && enabled && port_https) {
|
if (protocol !== 'https:' && enabled && port_https) {
|
||||||
checkRedirect(`https://${hostname}${httpsPort}/${hash}`);
|
checkRedirect(`https://${hostname}${httpsPort}/${hash}`);
|
||||||
} else if (protocol === 'https:' && enabled && port_https && port_https !== port) {
|
} else if (protocol === 'https:' && enabled && port_https && port_https !== parseInt(port, 10)) {
|
||||||
checkRedirect(`https://${hostname}${httpsPort}/${hash}`);
|
checkRedirect(`https://${hostname}${httpsPort}/${hash}`);
|
||||||
} else if (protocol === 'https:' && (!enabled || !port_https)) {
|
} else if (protocol === 'https:' && (!enabled || !port_https)) {
|
||||||
window.location.replace(`http://${hostname}:${httpPort}/${hash}`);
|
window.location.replace(`http://${hostname}:${httpPort}/${hash}`);
|
||||||
|
|
Loading…
Reference in a new issue