Skip to content

Commit 0bfb43e

Browse files
committed
Add missing CORS headers
1 parent 3a41336 commit 0bfb43e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

plugins/audit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,10 @@ def handleAuditLogRequest(self, request):
281281
client = HTTPClient(addr)
282282
answer = client.request(HTTPRequest(uri = uri, method = 'GET', body = query))
283283

284-
headers = { 'Content-Type': 'application/javascript' }
284+
headers = {
285+
'Content-Type': 'application/javascript',
286+
'Access-Control-Allow-Origin': '*'
287+
}
285288

286289
if answer.code == 200:
287290
data = json.loads(answer.body)

plugins/executionsummary.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ def handleTaskRequest(self, request):
3737
match = re.match('/tasks/([0-9a-z]+)/executionsummary', request.uri_path)
3838
task = match.group(1)
3939

40-
headers = { 'Content-Type': 'application/javascript' }
40+
headers = {
41+
'Content-Type': 'application/javascript',
42+
'Access-Control-Allow-Origin': '*'
43+
}
4144

4245
try:
4346
(summary, stat) = self.cluster.zk.get('/moneta/executionsummary/%s' % (task))
@@ -48,7 +51,10 @@ def handleTaskRequest(self, request):
4851

4952
def handleTasksRequest(self, request):
5053
"""Handle requests to /executionsummary"""
51-
headers = { 'Content-Type': 'application/javascript' }
54+
headers = {
55+
'Content-Type': 'application/javascript',
56+
'Access-Control-Allow-Origin': '*'
57+
}
5258

5359
tasks = {}
5460

0 commit comments

Comments
 (0)