From 17db2b760969e390803eb092623d82bd276b8bd4 Mon Sep 17 00:00:00 2001 From: Jari Voutilainen Date: Wed, 1 Nov 2017 10:23:58 +0200 Subject: [PATCH] move cors configuration ckan conf --- ansible/roles/ckan/templates/apache2.j2 | 4 ---- ansible/roles/ckan/templates/ckan.ini.j2 | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ansible/roles/ckan/templates/apache2.j2 b/ansible/roles/ckan/templates/apache2.j2 index 22f4a68382..ddb427c301 100644 --- a/ansible/roles/ckan/templates/apache2.j2 +++ b/ansible/roles/ckan/templates/apache2.j2 @@ -20,10 +20,6 @@ WSGISocketPrefix /var/run/wsgi #SSLCertificateFile {{ certificates_path }}/{{ssl_crt_primary}} #SSLCertificateKeyFile {{ certificates_path }}/{{ssl_key_primary}} - # allow CORS - Header always set Access-Control-Allow-Origin "*" - Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" - Header always set Access-Control-Allow-Headers "X-CKAN-API-KEY, Content-Type" # Respond to all OPTIONS requests with 200 OK # This could be done in the webapp diff --git a/ansible/roles/ckan/templates/ckan.ini.j2 b/ansible/roles/ckan/templates/ckan.ini.j2 index 5577dfc804..9bdbd48e20 100644 --- a/ansible/roles/ckan/templates/ckan.ini.j2 +++ b/ansible/roles/ckan/templates/ckan.ini.j2 @@ -63,7 +63,9 @@ ckan.locales_filtered_out = en_GB ckan.feeds.authority_name = ckan.feeds.date = ckan.feeds.author_name = -ckan.feeds.author_link = +ckan.feeds.author_link = + +ckan.cors.origin_allow_all = True email_to = {{ error_email }} error_email_from = {{ error_email_from }}