Skip to content

Instantly share code, notes, and snippets.

@asiletto
Last active August 29, 2015 14:02
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 asiletto/6708d173d16943708b37 to your computer and use it in GitHub Desktop.
Save asiletto/6708d173d16943708b37 to your computer and use it in GitHub Desktop.
enable CORS on drupal 7
<IfModule mod_headers.c>
#CORS
SetEnvIf Origin "^http(s)?://(.+\.)?(siletto\.it|localhost|localhost2)$" DYN_ORIGIN=$0
Header set Access-Control-Allow-Origin %{DYN_ORIGIN}e
Header set Access-Control-Allow-Methods "GET, PUT, POST, OPTIONS"
Header set Access-Control-Allow-Credentials true
Header set Access-Control-Allow-Headers "Authorization, Origin, Content-Type, X-CSRF-Token"
...
...
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment