mixed content the site was loaded over a secure connection but the file at was loaded over an insecu

文章讲述了在HTTPS网站中,由于尝试加载HTTP资源导致Chrome浏览器出现MixedContent警告的问题。此问题源于Chrome的安全检查机制,而Firefox和某些手机浏览器可能不会报错。尝试使用Meta标签的Content-Security-Policy升级不安全请求的方法无效。解决方案是将HTTP链接改为HTTPS。
摘要由CSDN通过智能技术生成

mixed content the site was loaded over a secure connection but the file at was loaded over an insecure connection

problem

问题: 在https地址试图通过a标签跳转到http下载地址时,浏览器报错
mixed content the site https://xxx was loaded over a secure connection but the file at http://yyy was loaded over an insecure connection

reason

原因

  • 推测是触发了 chrome 安全检查
  • “Mixed Content” warnings occur when an HTTPS page is asked to load a resource over HTTP.

测试发现

  • chrome 浏览器控制台会报错
  • firefox 浏览器不会报错
  • 手机自带浏览器也不会报错

solution

将跳转地址http改为https

<!-- 这个方法不可用 -->
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值