From ee80e6af6c3df40a7b417fb6fb555dd450115c72 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 6 Oct 2014 09:54:35 +0100 Subject: [PATCH] Force Access-Control-Allow-Origin for taginfo api responses 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 | 1 + cookbooks/taginfo/templates/default/apache.erb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cookbooks/taginfo/recipes/default.rb b/cookbooks/taginfo/recipes/default.rb index 93d161123..4fdcb933e 100644 --- a/cookbooks/taginfo/recipes/default.rb +++ b/cookbooks/taginfo/recipes/default.rb @@ -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" diff --git a/cookbooks/taginfo/templates/default/apache.erb b/cookbooks/taginfo/templates/default/apache.erb index 897cfcd21..288b13ff1 100644 --- a/cookbooks/taginfo/templates/default/apache.erb +++ b/cookbooks/taginfo/templates/default/apache.erb @@ -21,6 +21,10 @@ CacheEnable disk /api CacheEnable disk /embed CacheStaleOnError off + + + Header setifempty Access-Control-Allow-Origin * + <% end -%> -- 2.43.2