https改造之后,部分第三方资源,如bshare分享、cnzz统计等无法正常加载,在很多页面中会看到如下警报:

Mixed Content: The page at 'https://***.html' was loaded over HTTPS, but requested an insecure script 'http://***/b/buttonLite.js'. This request has been blocked; the content must be served over HTTPS.
Mixed Content: The page at 'https://***.html' was loaded over HTTPS, but requested an insecure script 'http://***'. This request has been blocked; the content must be served over HTTPS.

可以在页面meta头中加入:

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

自动将http的不安全请求升级为https

©本文为原创文章,著作权归博主所有,转载请联系博主获得授权

发表评论