简体   繁体   中英

No 'Access-Control-Allow-Origin' header in plunker

I see there are lots of threads about No 'Access-Control-Allow-Origin' header . My question is about how to solve this in plunker.

I have a piece of code in plunker , which tries to load an external html file. 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.

I tried to launch Chrome by open /Applications/Google\\ Chrome.app --args --disable-web-security , but it did not help.

Does anyone have any workaround to make loading an external html file work in plunker?

You can use an open CORS proxy like 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 .

The https://cors-anywhere.herokuapp.com/ proxy then adds the necessary CORS headers.

Or you can run your own instance from the source at https://github.com/Rob--W/cors-anywhere/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM