浏览器报Mixed Content错误的解决

正常来说一个网页中要么全部使用http,要么全部使用https 但是偶尔有些不完善的库自己会写死了调用的链接。

这里写图片描述

一个简单的方法是在网页的head下加入下面这句

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

这将会把http请求转化为https请求。这样就不会再出现Mixed Content的错误了。

猜你喜欢

转载自blog.csdn.net/weixin_40848638/article/details/82710650
今日推荐