[Vuejs]-Cors Issue when accessing steam API Vue Axios

0đź‘Ť

This is part of your web browser and your web server.

It basically stops malicious attacks, e.g.

  1. You visit my-innocent-blog.com and it has a “Like my website” button
  2. You click it, and it sends a request to StackOverflow to delete your account.
  3. StackOverflow servers receive the DELETE request, with the origin being my-innocent-blog.com, and it tells your web browser “That request should only originate from our own website”.
  4. Your web browser says “Okay, I’ll ignore the request and throw a CORS error”

Thus protecting you from accidentally being tricked into deleting your account (or worse).

If you’re using an ExpressJS server, check out their CORS package.
https://github.com/expressjs/cors

Otherwise, just search ” CORS” on Google and you’ll find something for pretty much everything.

Leave a comment