CORS错误从Intranet网页上要求到公共资源

发布于 2025-01-24 07:04:06 字数 793 浏览 4 评论 0原文

我有一个本地Web服务器设置在192.168.1.39带有域www.server.local.local。 DNS已配置为在我的路由器上正确解决此问题。

直到最近,一切都很好。如果我访问页面,例如www.server.local/page.html,我的浏览器开始报告以下错误。

Access to CSS stylesheet at 'https://cdn.jsdelivr.net/npm/[email protected]/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 Edge 94.0.992.31(官方构建)(x86_64)

I have a local web server set up at 192.168.1.39 with domain www.server.local. DNS has been configured to resolve this properly on my router.

Everything worked just fine until recently. My browser started to report the following error if I access page like www.server.local/page.html that references external resources.

Access to CSS stylesheet at 'https://cdn.jsdelivr.net/npm/[email protected]/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`.

However, if http://192.168.1.39/page.html is used, the page opens properly.

But the error message really confuses me, because it suggests the css hosted at jsdelivr is in a private address space! Seriously?! Or did I miss something?

My Browser: Microsoft Edge 94.0.992.31 (Official build) (x86_64)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别再吹冷风 2025-01-31 07:04:06

您可以尝试以下解决方案:

  1. open Edge并导航到edge:// flags/#block-insecure-private-network-requests
  2. 禁用突出显示的选项block insecure insecure nistecure dissecure divessecure私有网络请求
  3. 重新启动边缘并再次测试。

有关更多详细信息,您可以参考此博客: https:// developer。 chrome.com/blog/private-network-access-update/

You can try this solution:

  1. Open Edge and navigate to edge://flags/#block-insecure-private-network-requests
  2. Disable the highlighted option Block insecure private network requests.
  3. Restart Edge and test again.

For more details, you could refer to this blog: https://developer.chrome.com/blog/private-network-access-update/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文