What does the `Access-Control-Allow-Origin` header do, and what are its common values?

Question

Grade: Education Subject: Support
What does the `Access-Control-Allow-Origin` header do, and what are its common values?
Asked by:
86 Viewed 86 Answers

Answer (86)

Best Answer
(402)
`Access-Control-Allow-Origin` specifies which origins are allowed to access the resource. `*` allows requests from any origin (generally not recommended for production due to security concerns). A specific origin like `https://your-react-app.com` allows requests only from that origin. You can also specify multiple origins, but this is less common and often requires more complex server-side logic.