[LNT] r308859 - api: Set CORS
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 23 18:04:41 PDT 2017
Author: matze
Date: Sun Jul 23 18:04:41 2017
New Revision: 308859
URL: http://llvm.org/viewvc/llvm-project?rev=308859&view=rev
Log:
api: Set CORS
Set Cross-Origin Resource Sharing HTTP header for the REST api so it can
be used from javascript even if the script doesn't come from the same
server.
Modified:
lnt/trunk/lnt/server/ui/api.py
Modified: lnt/trunk/lnt/server/ui/api.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/api.py?rev=308859&r1=308858&r2=308859&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/api.py (original)
+++ lnt/trunk/lnt/server/ui/api.py Sun Jul 23 18:04:41 2017
@@ -463,6 +463,7 @@ def load_api_resources(api):
def output_json(data, code, headers=None):
'''Override output_json() to use LNT json encoder'''
resp = make_response(json.dumps(data), code)
+ resp.headers.add('Access-Control-Allow-Origin', '*')
if headers is not None:
resp.headers.extend(headers)
return resp
More information about the llvm-commits
mailing list