Cross-Origin Resource Sharing (CORS) is a W3C specification that allows cross-origin requests. It works by adding HTTP headers to Cross-origin resource requests and responses.
The CORS standard is necessary because it allows local resources on a web page to be requested from another domain. As a result, a web page may be restricted by relying on the same-origin policy, a security measure that determines how documents or scripts loaded from one origin can interact with resources from another.