Simple way to check if your API has CORS configured for any origin (i.e *). Note CORS only applies for browsers or apps, not curl.
- browse to https://www.google.com/
- open dev tools and the console tab where you can run javascript
- copy and paste this:
fetch("https://yahoo.com").then(res => res.json()).then(console.log)
- hit enter to execute it and you should errors (as yahoo is not open to CORS from google)
- change the url to your API end point and try again. If CORS is setup to allow any origin there will not be any errors
Top comments (0)