首页 > 其他分享 >Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure script ‘<URL>‘.

Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure script ‘<URL>‘.

时间:2022-10-31 16:01:21浏览次数:57  
标签:requested URL insecure Content HTTPS Mixed loaded over

报错信息:
Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure script ‘’. This request has been blocked; the content must be served over HTTPS.

出错原因:
因为谷歌浏览器对于https链接会自动屏蔽不安全的http链接,就是所谓的Mixed Content。HTTPS页面里动态的引入HTTP资源时,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。
解决方案:
在相应页面的head中加入一段代码即可:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">  


这段代码的意思是 自动将http的不安全请求升级为https 。

标签:requested,URL,insecure,Content,HTTPS,Mixed,loaded,over
From: https://www.cnblogs.com/zzsdream/p/16844618.html

相关文章