HTTP协议改HTTPS


//获取源机器的协议

string protocol = Request.Url.AbsoluteUri.ToLower().IndexOf("https") != -1 ? "https://" : "http://";

//获取绝对路径

function getAbsoluteUrl(url) {
    var a = document.createElement('A');
    a.href = url; 
    url = a.href;  
    if (url.indexOf('/player/video.aspx') != -1) {
        return url.toLowerCase().replace("https", "http");
    }
    return url;
}

//替换http为https

function getprotocol(url) {
    var ishttps = 'https:' == document.location.protocol ? true : false;
    if (ishttps) {
        return url.replace("http://", "https://");
    } else {
        return url;
    }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM