Glossary

CORS

KORZ

A browser security rule that controls which websites can read data from another domain.

CORS (Cross-Origin Resource Sharing) is a browser mechanism that decides whether a page on one origin (domain, protocol and port) can read responses from another.

How it works

By default, the browser blocks a page on app.com from reading responses from api.other.com. The server can allow it by sending a header like:

Access-Control-Allow-Origin: https://app.com

For some requests, the browser first sends a “preflight” OPTIONS request to check permission.

Why it matters

The famous “blocked by CORS policy” error means the server didn’t allow your origin. The fix is on the server, not in your frontend code. Avoid * for APIs that use cookies or private data. CORS isn’t authentication either, so still protect your API with something like OAuth or JWT.