Skip to content

Instantly share code, notes, and snippets.

@otobrglez
Created July 29, 2014 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otobrglez/500866a4a3f2cd817e13 to your computer and use it in GitHub Desktop.
Save otobrglez/500866a4a3f2cd817e13 to your computer and use it in GitHub Desktop.
How to test if your CORS configuration works?
#!/usr/bin/env bash
# Target host: http://aioo-api.dev
# Testing from origin: http://aioo-spa.dev
# Method: "POST"
curl --verbose --request OPTIONS http://aioo-api.dev \
--header 'Origin: http://aioo-spa.dev' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: POST'
# Use, share, collaborate. ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment