]> git.openstreetmap.org Git - chef.git/commitdiff
Always set Access-Control-Allow-Origin for tile responses
authorTom Hughes <tom@compton.nu>
Fri, 30 Aug 2013 09:49:54 +0000 (10:49 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 30 Aug 2013 09:49:54 +0000 (10:49 +0100)
This allows "simple" requests using CORS to be cached as we will
always say they are allowed even if the client didn't actually ask
for CORS by specifying an origin.

Preflight requests will still be handled by mod_tile which may add
additional headers for a fuller response.

cookbooks/tile/templates/default/apache.erb

index 9199cb3a9e64412174f3b22fbf9e36ef3c60ce82..91a901e45337cc1fccdc8ac4b2e5c573dec39361 100644 (file)
   ErrorLog /var/log/apache2/error.log
   BufferedLogs on
 
   ErrorLog /var/log/apache2/error.log
   BufferedLogs on
 
+  # Always set Access-Control-Allow-Origin so that simple CORS requests
+  # will always work and can be cached
+  Header set Access-Control-Allow-Origin "*"
+
   # Enable the rewrite engine
   RewriteEngine on
 
   # Enable the rewrite engine
   RewriteEngine on