Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.

本文探讨了在HTTPS页面中引入HTTP资源时遇到的MixedContent问题,并提供了具体的解决方案,即通过使用<meta>标签来自动升级http请求为https。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在升级https的过程中,出现如下问题:

Mixed Content: The page at 'https://www.xxx.com/denglu.html' was loaded over HTTPS, but requested an insecure script 'http://qzonestyle.gtimg.cn/qzone/openapi/qc-1.0.1.js'. This request has been blocked; the content must be served over HTTPS.

 

 

问题抛出:如何在HTTPS 网页中引入HTTP资源: Mixed Content?

问题原因:HTTPS页面里动态的引入HTTP资源,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。

解决方案:

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

可以在相应的页面的<head>里加上这句代码,意思是自动将http的不安全请求升级为https

参考:https://thehackernews.com/2015/04/disable-mixed-content-warning.html

 

 

Mixed Content: The page at 'https://www.4399.com/flash/78072qh.htm' was loaded over HTTPS, but requested an insecure script 'http://newsimg.5054399.com/js/checkMobile.js'. This request has been blocked; the content must be served over HTTPS. 78072qh.htm:9 Uncaught ReferenceError: check_mobile is not defined at 78072qh.htm:9:9 (匿名) @ 78072qh.htm:9 78072qh.htm:16 document.domain mutation is ignored because the surrounding agent cluster is origin-keyed. (匿名) @ 78072qh.htm:16 78072qh.htm:161 Mixed Content: The page at 'https://www.4399.com/flash/78072qh.htm' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://news.4399.com/zmxy3/search.php'. This endpoint should be made available over a secure connection. 78072qh.htm:63 Mixed Content: The page at 'https://www.4399.com/flash/78072qh.htm' was loaded over HTTPS, but requested an insecure frame 'http://sda.4399.com/4399swf/upload_swf/ftp7/hanbao/20120107/6/x3v0529.htm'. This request has been blocked; the content must be served over HTTPS. 78072qh.htm:1 Mixed Content: The page at 'https://www.4399.com/flash/78072qh.htm' was loaded over HTTPS, but requested an insecure script 'http://4399stat.5054399.com/js/click.js'. This request has been blocked; the content must be served over HTTPS. 78072qh.htm:1 Mixed Content: The page at 'https://www.4399.com/flash/78072qh.htm' was loaded over HTTPS, but requested an insecure script 'http://www.4399.com/js/4399stat.js'. This request has been blocked; the content must be served over HTTPS. 78072qh.htm:1 Mixed Content: The page at 'https://www.4399.com/flash/78072qh.htm' was loaded over HTTPS, but requested an insecure script 'http://s25.cnzz.com/stat.php?id=4073713&web_id=4073713&show=pic'. This request has been blocked; the content must be served over HTTPS.
04-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值