The request client is not a secure context and the resource is in more-private address space private

问题
突然间文档平台http://doc.xxx.cn所有视频无法播放,控制台报错如下: Access to XMLHttpRequest at 'https://xxx.yyy.com?accessKey=Y7TkK6ML2Pt0TAht&fragmentNum=0' from origin 'http://zzz.cn' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private.

360截图16751026342553.png

原因
Chrome浏览器94及以后的版本,引入了弃用试验Block insecure private network requests,就是当目标站点的ip地址比请求发起者的ip地址更加私密时,会进行阻止。 http://localhost > https://abc.xxx.com > http://yyy.cn ,所以从http://yyy.cn向https://carvodpre.intra.xiaojukeji.comabc.xxx.com 发起请求会报错!

解决
以下任意一种方法即可

  1. 使用Chrome低版本或其他浏览器。
  2. 将网站升级为https。
  3. 在Chrome浏览器地址栏搜索chrome://flags,然后在搜索框搜索Block insecure private network requests,最后将其Default改为Disabled。

标题:The request client is not a secure context and the resource is in more-private address space private
作者:admin
地址:http://www.mjdg.store/articles/2022/04/21/1650530965595.html

    评论
    0 评论
avatar

取消