What does CORS stand for and what is its purpose?

rusty1_rusty1 asked this question 1 year, 8 months ago
rusty1_rusty1 on Jan 27, 2022

I've seen a lot of people talking about CORS when their building frontend applications.

What does it stand for and what is its purpose?

2 suggested answers
suparman21 on Feb 7, 2022

Cross-Origin Resource Sharing.

When JavaScript makes a XmlHttpRequest to a server with a different origin than its own, the CORS settings will be checked. If the browser supports CORS, it will start the CORS process. Otherwise, an error will be the result.

When a server encounters the cors header, it will determine if the origin is in its list of locations it accepts requests from. And will fail if the origin is not allowed.

0 replies
nick on Feb 7, 2022

It stands for "Cross-Origin Resource Sharing".

Read more about it here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

0 replies