How to use CORS
- 1. Set the request Origin and method. What the page would send.
- 2. List extra headers. Authorization and Content-Type often trigger preflight.
- 3. Set response ACAO / ACAM / ACAH. From the API.
- 4. Read allow/block. Credentials cannot pair with *.
About this tool
CORS is enforced by browsers, not by curl. Simulating the policy locally is faster than redeploying nginx. This does not send OPTIONS anywhere.
Simple vs preflight
GET/POST with a few headers skip preflight. Authorization is not simple.
Credentials
Allow-Origin cannot be * if cookies or Authorization with credentials mode are used.
Code examples
Header
Access-Control-Allow-Origin: https://app.example.com