简体   繁体   English

在plunker中没有'Access-Control-Allow-Origin'标题

[英]No 'Access-Control-Allow-Origin' header in plunker

I see there are lots of threads about No 'Access-Control-Allow-Origin' header . 我看到有很多关于No 'Access-Control-Allow-Origin' header My question is about how to solve this in plunker. 我的问题是关于如何在plunker中解决这个问题。

I have a piece of code in plunker , which tries to load an external html file. 我在plunker中有一段代码,它试图加载一个外部html文件。 It gives an error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://run.plnkr.co' is therefore not allowed access. 它给出了错误No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://run.plnkr.co' is therefore not allowed access. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://run.plnkr.co' is therefore not allowed access.

I tried to launch Chrome by open /Applications/Google\\ Chrome.app --args --disable-web-security , but it did not help. 我试图通过open /Applications/Google\\ Chrome.app --args --disable-web-security启动Chrome,但它没有帮助。

Does anyone have any workaround to make loading an external html file work in plunker? 有没有人有任何解决方法来加载外部html文件在plunker中工作?

You can use an open CORS proxy like https://cors-anywhere.herokuapp.com/ . 您可以使用开放式CORS代理,例如https://cors-anywhere.herokuapp.com/

The way it works is, instead of making your request directly to https://site.to.request you make your request to https://cors-anywhere.herokuapp.com/https://site.to.request . 它的工作方式是,而不是直接向https://site.to.request提出请求,而是向https://cors-anywhere.herokuapp.com/https://site.to.request提出请求。

The https://cors-anywhere.herokuapp.com/ proxy then adds the necessary CORS headers. 然后https://cors-anywhere.herokuapp.com/代理添加必要的CORS标头。

Or you can run your own instance from the source at https://github.com/Rob--W/cors-anywhere/ 或者您可以从源代码运行您自己的实例: https://github.com/Rob--W/cors-anywhere/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Chrome没有'Access-Control-Allow-Origin'标题,但标题就在那里 - Chrome saying No 'Access-Control-Allow-Origin' header, but the header is there SAPUI5 中的 Access-Control-Allow-Origin' 标头错误 - Access-Control-Allow-Origin' header error in SAPUI5 如果 CORS 标头“Access-Control-Allow-Origin”为“*”,则不支持凭据 - Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’ 随机得到没有'Access-Control-Allow-Origin' header 存在 - Randomly got No 'Access-Control-Allow-Origin' header is present 'Access-Control-Allow-Origin'标头包含多个值 - The 'Access-Control-Allow-Origin' header contains multiple values Github中Jekyll站点中的Access-Control-Allow-Origin HTTP标头 - Access-Control-Allow-Origin HTTP header in Jekyll site in Github 请求的资源上不存在“Access-Control-Allow-Origin”标头? - No 'Access-Control-Allow-Origin' header is present on the requested resource? 没有响应标头时允许CORS Access-Control-Allow-Origin - CORS allowed when no response header Access-Control-Allow-Origin Access-Control-Allow-Origin不允许使用Origin? - Origin is not allowed by Access-Control-Allow-Origin? Chrome 中的 Access-Control-Allow-Origin 错误 - Access-Control-Allow-Origin error in Chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM