Created
August 13, 2015 05:46
-
-
Save TomA-R/aaca4f6c7fb53319d5f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Serve .vtt files with Access-Control-Allow-Origin: * header if referer is the correct domain | |
<IfModule mod_setenvif.c> | |
<FilesMatch "\.vtt$"> | |
SetEnvIf Referer "^http(s)?://(.+\.)?somedomain\.com/" VALID_REFERER=$1 | |
Header set Access-Control-Allow-Origin "*" env=VALID_REFERER | |
</FilesMatch> | |
</IfModule> | |
You could also use origin | |
Persisting issue: this doesn't work properly if you're behind ATS/Squid/.. which caches requests without taking headers into account |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment