https网站解决block:mixed-content问题

今天发现一个警告
 
Mixed Content: The page was loaded over HTTPS,blocked the content must be served over HTTPS.,。。
百度了一下含义是因为
是浏览器不允许在https页面里嵌入http的请求,现在高版本的浏览器为了用户体验,都不会弹窗报错,只会在控制台上打印一条错误信息。
最简单的解决办法当然就是不要使用http请求,把网站上的http请求都迁移到https。
 
页面的head中加入:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
意思是自动将http的不安全请求升级为https
 
 
 
 
 
 
 
 
 
 
 
 

posted @ 2020-12-23 23:34  anobscureretreat  阅读(441)  评论(0编辑  收藏  举报