Skip to content

Instantly share code, notes, and snippets.

@caprica
Created June 15, 2022 07:42
Show Gist options
  • Save caprica/250c546132d11bb029e5c1a0ae464374 to your computer and use it in GitHub Desktop.
Save caprica/250c546132d11bb029e5c1a0ae464374 to your computer and use it in GitHub Desktop.
Testing CORS headers with curl
curl -H "Access-Control-Request-Method: GET" -H "Origin: http://localhost:3000" --head http://my.api.com/whatever
curl -H "Access-Control-Request-Method: GET" -H "Origin: http://localhost:3000" --head http://my.api.com/whatever | grep "<"
curl -H "Access-Control-Request-Method: GET" -H "Origin: http://localhost:3000" --head http://my.api.com/whatever | grep "Access-Control"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment