Skip to content

Instantly share code, notes, and snippets.

@gaetancollaud
Last active September 14, 2016 15:28
Show Gist options
  • Save gaetancollaud/014c20ad48e9db5782bbc47506166634 to your computer and use it in GitHub Desktop.
Save gaetancollaud/014c20ad48e9db5782bbc47506166634 to your computer and use it in GitHub Desktop.
CrossOrigin
#BEGIN TELCRED
SetEnvIf Origin "^http(s)?://(.+\.)?(telcred\.net|localhost)(:\d+)$" origin_is=$0
Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is
Header always set Access-Control-Allow-Credentials %{origin_is}e env=origin_is
Header always set Access-Control-Allow-Headers "Authorization,Content-Type" env=origin_is
Header always set Access-Control-Request-Method "GET,POST,OPTIONS" env=origin_is
#END TELCRED
RewriteCond %{REQUEST_METHOD} !OPTIONS
a2enmod allowmethods
apachectl -t
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment