Fixed http port and reset with save

This commit is contained in:
Ildar Kamalov 2019-02-20 12:46:34 +03:00
parent a2dd7c32d5
commit 2c2295c161
6 changed files with 23 additions and 7 deletions
client/src/helpers

View file

@ -171,7 +171,7 @@ export const redirectCheck = (url) => {
}, STOP_TIMEOUT);
};
export const redirectToCurrentProtocol = (values) => {
export const redirectToCurrentProtocol = (values, httpPort = 80) => {
const {
protocol, hostname, hash, port,
} = window.location;
@ -183,6 +183,6 @@ export const redirectToCurrentProtocol = (values) => {
} else if (protocol === 'https:' && enabled && port_https && port_https !== port) {
redirectCheck(`https://${hostname}${httpsPort}/${hash}`);
} else if (protocol === 'https:' && (!enabled || !port_https)) {
window.location.replace(`http://${hostname}/${hash}`);
window.location.replace(`http://${hostname}:${httpPort}/${hash}`);
}
};