EcoSIS extension for CKAN adding resource controls for spectra
info on pycharm package install can be found here
. /usr/lib/ckan/default/bin/activate
# run ckan as root
sudo pycharm-community
select virtual env python as interpreter, then
script = /usr/lib/ckan/default/bin/paster
script paramters = --plugin=ckan serve /etc/ckan/default/development.ini
in ckan/lib/base.py
def _set_cors(self):
- response.headers['Access-Control-Allow-Origin'] = "*"
+ #response.headers['Access-Control-Allow-Origin'] = "*"
+ if 'Origin' in request.headers:
+ response.headers['Access-Control-Allow-Origin'] = request.headers['Origin']
+ else:
+ response.headers['Access-Control-Allow-Origin'] = "*"
+
response.headers['Access-Control-Allow-Methods'] = \
"POST, PUT, GET, DELETE, OPTIONS"
response.headers['Access-Control-Allow-Headers'] = \
"X-CKAN-API-KEY, Authorization, Content-Type"
+ response.headers['Access-Control-Allow-Credentials'] = "true"