lundi 26 avril 2021

RSS from web app - CORS problems - simple solution [duplicate]

I want to add RSS to my webApp.

I encountered this “CORS” problem which cause the request to be failed (in the dev env anyway),

Access to XMLHttpRequest at 'http://rss.cnn.com/rss/edition.rss' from origin 'http://localhost:3007' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

and I’m aware to such solution of using “CORS” proxies, or create one proxy by myself.

There are problems with such online server since, it’s restricted, I need to request temp access each time.

https://cors-anywhere.herokuapp.com/

My question is how do I should do it?

And why this problem has no other simple solution that can be implemented in the code level?

The web is full with “simple data” pages which CORS same origin restrictions aren’t relevant there. To open new proxy only for access data from localhost seems exaggerate task in my eyes.




Aucun commentaire:

Enregistrer un commentaire