DEV Community

Harry Patel
Harry Patel

Posted on

Simple CORS checker

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.

  1. browse to https://www.google.com/
  2. open dev tools and the console tab where you can run javascript
  3. copy and paste this: fetch("https://yahoo.com").then(res => res.json()).then(console.log)
  4. hit enter to execute it and you should errors (as yahoo is not open to CORS from google) Alt Text
  5. 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 Alt Text

Top comments (0)