我有一个本地web服务器设置在192.168.1.39与域www.server.local。DNS已配置为在我的路由器上正确解决此问题。
直到最近一切都很顺利。如果我访问引用外部资源的www.server.local/page.html这样的页面,浏览器就会报告以下错误。
Access to CSS stylesheet at 'https://cdn.jsdelivr.net/npm/reveal.js@4.1.0/dist/reset.css' from origin 'http://www.server.local' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space `local`.但是,如果使用http://192.168.1.39/page.html,则页面将正确打开。
但是错误消息确实让我感到困惑,因为它表明jsdelivr托管的css位于私有地址空间中!说真的?!还是我错过了什么?
我的浏览器: Microsoft 94.0.992.31 (正式构建) (x86_64)
发布于 2022-04-28 06:28:31
您可以尝试此解决方案:
打开边缘并导航到edge://flags/#block-insecure-private-network-requests
Block insecure private network requests.
有关更多细节,请参考以下博客:https://developer.chrome.com/blog/private-network-access-update/
https://stackoverflow.com/questions/72024284
复制相似问题