解决https页面中包含http ajax请求问题

作者:FancyPig | 发布时间:

相关问题

java项目出现下面的Mixed content blocked报错

jquery.min.js:2 Mixed Content: The page at 'https://sign.pigsec.cn/' was loaded over HTTPS, but requested an insecure frame 'http://sign.pigsec.cn/login'. This request has been blocked; the content must be served over HTTPS.

修复方法

我们这里其实已经强制https验证了,但是js代码中用的是http请求,如果你比较懒,可以直接在页面中加入下面的代码

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

然后问题就解决了