[英]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.