前段时间有项目是在HTTPS协议下引入了HTTP协议的图,结果导致图不能显示,提示如下:
Mixed Content: The page at 'https://www.xxx.cn' was loaded over HTTPS, but requested an insecure element 'http://www.xxx.cn/assets/t.png' This request was automatically upgraded to HTTPS, For more information see'https://blog.chromium.org/2019/10/no-more-mixed- messages-about-https.html'
通过提示可以看到,HTTPS协议下引入HTTP协议的图,是认为不安全的,图的地址会被自动转换为HTTPS协议,因此会导致找不到图
其实上述情况,css,js,都会有该限制。
原则上HTTPS调用HTTP资源受到限制,HTTP调用HTTPS资源不受限制