CORS Header Tester
Test CORS headers — Access-Control-Allow-Origin, methods, credentials.
CORS Explained: Cross-Origin Resource Sharing
CORS is a browser-enforced security mechanism that controls which web origins can access resources on a different origin. Without proper CORS headers, browser JavaScript from example.com cannot fetch data from api.other.com — even if both domains are owned by the same organization.
Key headers: Access-Control-Allow-Origin (which origins are allowed — * for public APIs), Access-Control-Allow-Methods (GET, POST, PUT, DELETE), Access-Control-Allow-Headers (custom headers the client may send), Access-Control-Allow-Credentials (allows cookies and auth tokens). Preflight requests use the OPTIONS method to check permissions before the actual request.
Common CORS Errors & Fixes
CLI Equivalent
curl -sI -H "Origin: https://example.com" https://api.example.com | grep -i access-control