-1

I have used this end point in my react-app which is publicly available.

Even though this endpoint is publicly available to everyone unfortunately they have not set Access-Control-Allow-Origin to all so I had to use moseif cors extension to skip the cors issue in dev environment. The endpoint works when tried with postman.

But even after deploying my react app to firebase the end point emits a cors error.

Access to XMLHttpRequest at 'https://www.covidvisualizer.com/api' from origin 'https://example.firebaseapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Is there something that I'm missing ?

Is there a way to override the cors issue from my side because i have zero control over the backend end point that i'm trying to access.

Isn't deploying my react-app to a server supposed to fix this cors issue ?

Thanks.

Dante_97
  • 73
  • 1
  • 14

1 Answers1

0

Seems like your endpoint doesn't support CORS, you can test it out here https://www.test-cors.org, there is no way to override this behavior since it is a browser security feature, yes, the endpoint is public and available for Http GET calls but maybe it doesn't support the OPTIONS preflight request that is issued when firing ajax calls, hence your app won't be able to reach out the endpoint unless you make an intermediate backend call to the endpoint.

Enrique Olvera
  • 134
  • 1
  • 4