(function(){
if (location.protocol !== 'https:'){
var reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
if(!reg.test(location.host.split(":")[0]) && location.host.indexOf('localhost') === -1){
location.replace('https://' + location.href.split('//')[1]);
}
}else{
let head = document.getElementsByTagName("head");
let meta = document.createElement("meta");
meta.content = "upgrade-insecure-requests";
meta.httpEquiv = "Content-Security-Policy";
head[0].appendChild(meta);
}
})()