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

 

W3C 工作组考虑到了我们升级 HTTPS 的艰难,在 2015 年 4 月份就出了一个 Upgrade Insecure Requests 的草案,他的作用就是让浏览器自动升级请求。

在我们服务器的响应头中加入:

header("Content-Security-Policy: upgrade-insecure-requests");

 

页面是 https 的,而这个页面中包含了大量的 http 资源(图片、iframe等),页面一旦发现存在上述响应头,会在加载 http 资源时自动替换成 https 请求。

 

相关文章:

  • 2021-10-06
  • 2022-12-23
  • 2021-12-07
  • 2021-09-18
  • 2022-12-23
  • 2021-10-19
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2021-07-31
  • 2022-12-23
  • 2021-10-14
  • 2022-02-04
  • 2022-12-23
相关资源
相似解决方案