JavaScript · Middle · Question 40 of 75
What is CORS?
- ✓Correct answer: A mechanism by which a server allows the browser to make requests from another origin
- 2Server protection against DDoS attacks that the browser enables automatically
- 3A data encryption format between the browser and the server
Explanation
Under the same-origin policy, the browser doesn't let a script read responses from another domain unless the server sends Access-Control-Allow-Origin. For "non-simple" requests, a preflight OPTIONS is sent first. It's a browser restriction: curl or a server don't apply it.