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

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

参考网址:

https://blog.csdn.net/zhoulcc/article/details/121311282?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163894934616780264081794%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163894934616780264081794&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-2-121311282.pc_search_result_cache&utm_term=has+been+blocked+by+CORS+policy%3A+The+request+client+is+not+a+secure+context+and+the+resource+is+in+more-private+address+space+%60local&spm=1018.2226.3001.4187

情景再现

前后端分离项目 ,本地启动 , 使用局域网 ip 去访问 ,发现异步请求发送失败,使用 localhost 访问项目 ,发送异步是可以,后面查找了一些资料,上面的参考网址的方案解决了这个问题

报错

google 浏览器控制台报错

Access to XMLHttpRequest at ‘xx’ from origin ‘xx’ has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local

解决方法

  • 打开浏览器输入网址

网址为:

chrome://flags/#block-insecure-private-network-requests

  • 设置

找到**Block insecure private network requests并将其设置为Disabled

  • 重启浏览器生效

其设置为Disabled

  • 重启浏览器生效

image-20211208211930340

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值