Fixed port validation
This commit is contained in:
parent
8e993cd788
commit
158f2f6100
|
@ -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 New Issue