Skip to content

Instantly share code, notes, and snippets.

@gorkdesign
Forked from brianlmoon/apache_cors_example
Created April 25, 2023 10:02
Show Gist options
  • Save gorkdesign/0240e9a3975ad97648a676091a7e21ca to your computer and use it in GitHub Desktop.
Save gorkdesign/0240e9a3975ad97648a676091a7e21ca to your computer and use it in GitHub Desktop.

Revisions

  1. @brianlmoon brianlmoon revised this gist Mar 10, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion apache_cors_example
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,6 @@
    # for both SSL and non-SSL
    SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
    Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
    Header set Access-Control-Allow-Credentials "true" env=ORIGIN
    Header set Access-Control-Allow-Credentials "true" env=ORIGIN
    # Always set Vary: Origin when it's possible you may send CORS headers
    Header merge Vary Origin
  2. @brianlmoon brianlmoon revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion apache_cors_example
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Sets CORS headers for request from example.com and example2.com pages
    # Sets CORS headers for request from example1.com and example2.com pages
    # for both SSL and non-SSL
    SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
    Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
  3. @brianlmoon brianlmoon created this gist Mar 10, 2015.
    5 changes: 5 additions & 0 deletions apache_cors_example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Sets CORS headers for request from example.com and example2.com pages
    # for both SSL and non-SSL
    SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
    Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
    Header set Access-Control-Allow-Credentials "true" env=ORIGIN