Published on

What is CORS?

Authors
  • avatar
    Name
    Hyun Myung Kim
    Twitter

cross-origin

cross-origin refers to any one of the following 3 cases:

  1. Protocol - When the two protocols are different. (HTTP and HTTPS)
  2. Origin - When the origins are different. (domain.com and sub.domain.com)
  3. Port number - When the port numbers are different. (3000 and 4000)

The browser limits the cross-origin HTTP requests due to security reasons.


What is CORS?

Cross-Origin Resource Sharing (CORS) is a browser mechanism which enables controlled access to resources located outside of a given domain.

However, it also provides potential for cross-domain attacks, if a website's CORS policy is poorly configured and implemented. CORS is not a protection against cross-origin attacks such as cross-site request forgery (CSRF).

.... to be continued