Force Access-Control-Allow-Origin for taginfo api responses
authorTom Hughes <tom@compton.nu>
Mon, 6 Oct 2014 08:54:35 +0000 (09:54 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 6 Oct 2014 08:55:56 +0000 (09:55 +0100)
This is a horrid hack as a workaround pending a fix to the actual
bug in apache:

https://issues.apache.org/bugzilla/show_bug.cgi?id=56898

cookbooks/taginfo/recipes/default.rb
cookbooks/taginfo/templates/default/apache.erb

index 93d1611235dcbe6517110daf6b8eca0846c14aa9..4fdcb933e4c2a579f3971df5052ae1eb9f1b8fe3 100644 (file)
@@ -50,6 +50,7 @@ gem_package "rack-contrib"
 
 apache_module "cache"
 apache_module "cache_disk"
+apache_module "headers"
 
 template "/etc/cron.d/taginfo" do
   source "cron.erb"
index 897cfcd215e7aa03ced80f51ac76ed3540cafb3c..288b13ff1c6f991358dc439cbd2edc4c7f7550ca 100644 (file)
         CacheEnable disk /api
         CacheEnable disk /embed
         CacheStaleOnError off
+
+        <Location /api>
+                Header setifempty Access-Control-Allow-Origin *
+        </Location>
 </VirtualHost>
 <% end -%>