From 42b807e6849dffb8463819c2379c4c29994dba03 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 30 Aug 2013 10:49:54 +0100 Subject: [PATCH 1/1] 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. --- cookbooks/tile/templates/default/apache.erb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.43.2