From: Tom Hughes Date: Fri, 30 Aug 2013 09:49:54 +0000 (+0100) Subject: Always set Access-Control-Allow-Origin for tile responses X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/42b807e6849dffb8463819c2379c4c29994dba03 Always set Access-Control-Allow-Origin for tile responses 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. --- diff --git a/cookbooks/tile/templates/default/apache.erb b/cookbooks/tile/templates/default/apache.erb index 9199cb3a9..91a901e45 100644 --- a/cookbooks/tile/templates/default/apache.erb +++ b/cookbooks/tile/templates/default/apache.erb @@ -26,6 +26,10 @@ 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