gpt4 book ai didi

google-chrome - plunker 中没有 'Access-Control-Allow-Origin' header

转载 作者:行者123 更新时间:2023-12-02 01:15:56 24 4
gpt4 key购买 nike

我看到有很多关于 No 'Access-Control-Allow-Origin' header 的话题。我的问题是关于如何在 plunker 中解决这个问题。

我在plunker中有一段代码,它会尝试加载外部 html 文件。它给出错误 No 'Access-Control-Allow-Origin' header is present on the requested resource。因此不允许访问来源“https://run.plnkr.co”。

我尝试通过 open/Applications/Google\Chrome.app --args --disable-web-security 启动 Chrome,但没有帮助。

有没有人有任何解决方法可以在 plunker 中加载外部 html 文件?

最佳答案

您可以使用开放式 CORS 代理,例如 https://cors-anywhere.herokuapp.com/ .

它的工作方式是,不是直接向 https://site.to.request 发出请求,而是向 https://cors-anywhere.herokuapp 发出请求。 com/https://site.to.request.

https://cors-anywhere.herokuapp.com/然后代理添加必要的 CORS header 。

或者您可以从位于 https://github.com/Rob--W/cors-anywhere/ 的源运行您自己的实例

关于google-chrome - plunker 中没有 'Access-Control-Allow-Origin' header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42638432/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com