Skip to content

Commit

Permalink
Send CORS headers if browsers request them. This enables CORS-enabled…
Browse files Browse the repository at this point in the history
… images (@crossorigin). Closes h5bp#797.
  • Loading branch information
mathiasbynens committed Nov 28, 2011
1 parent fdb58e6 commit 2727fa2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .htaccess
Expand Up @@ -38,7 +38,7 @@
# Cross-domain AJAX requests
# ----------------------------------------------------------------------

# Serve cross-domain ajax requests, disabled.
# Serve cross-domain Ajax requests, disabled by default.
# enable-cors.org
# code.google.com/p/html5security/wiki/CrossOriginRequestSecurity

Expand All @@ -47,6 +47,22 @@
# </IfModule>


# ----------------------------------------------------------------------
# CORS-enabled images (@crossorigin)
# ----------------------------------------------------------------------

# Send CORS headers if browsers request them; enabled by default.
# developer.mozilla.org/en/CORS_Enabled_Image
# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/

<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</IfModule>
</IfModule>


# ----------------------------------------------------------------------
# Webfont access
Expand Down

0 comments on commit 2727fa2

Please sign in to comment.