summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2017-12-13 11:25:22 -0600
committerMonty Taylor <mordred@inaugust.com>2017-12-13 11:32:18 -0600
commitd59c61ddc65db8fff7cbbf968a26c63e97918fb2 (patch)
treefd05d738fd353bda5cce6c4bae0e02cc48cabdfc
parent83f504c966c0b83a2ae1e174975d7ba5bd7a705e (diff)
downloadzuul-d59c61ddc65db8fff7cbbf968a26c63e97918fb2.tar.gz
Send open CORS header for jobs and builds
We don't have any precious data yet, so keep builds and jobs open like status. This lets us use built artifacts as preview from CI jobs. Change-Id: I81cad00d2d8f0b763601fc67a4863faa96037fc7
-rwxr-xr-xzuul/web/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py
index e4a361205..488524309 100755
--- a/zuul/web/__init__.py
+++ b/zuul/web/__init__.py
@@ -190,7 +190,9 @@ class GearmanHandler(object):
def job_list(self, request):
tenant = request.match_info["tenant"]
job = self.rpc.submitJob('zuul:job_list', {'tenant': tenant})
- return web.json_response(json.loads(job.data[0]))
+ resp = web.json_response(json.loads(job.data[0]))
+ resp.headers['Access-Control-Allow-Origin'] = '*'
+ return resp
def key_get(self, request):
source = request.match_info["source"]
@@ -290,6 +292,7 @@ class SqlHandler(object):
raise ValueError("Unknown parameter %s" % k)
data = self.get_builds(args)
resp = web.json_response(data)
+ resp.headers['Access-Control-Allow-Origin'] = '*'
except Exception as e:
self.log.exception("Jobs exception:")
resp = web.json_response({'error_description': 'Internal error'},