Do you know what is CORS and how to fix CORS errors?
CORS restricts any clients(domains) get access to your server!
All modern browsers are honest enough and handle such a situation themselves. Especially if we’ve integrated js in our code, the browser will never allow us to access the cross-origin requests unless we allow it!
When working on the application, whose backend and frontend rely on different origins, we will be forced to configure CORS headers.
Appropriately setting CORS will save you from security vulnerabilities at an earlier stage.
Also, enabling appropriate CORS allows us to set and get custom request/response headers.
Dangerous-looking CORS errors are actually dangerous for unauthorized clients and saviors for us!
For detailed implementation, check out original post.