Add Access-Control-Allow-Origin: * to the response header

This commit is contained in:
Nicolas Hennion 2013-04-14 15:57:22 +02:00
parent bd73000765
commit 0fa3d145a5

View File

@ -3407,6 +3407,16 @@ class GlancesHandler(SimpleXMLRPCRequestHandler):
"""
rpc_paths = ('/RPC2',)
def end_headers(self):
# Hack to add a specific header
# Thk to: https://gist.github.com/rca/4063325
self.send_my_headers()
SimpleXMLRPCRequestHandler.end_headers(self)
def send_my_headers(self):
# Specific header is here (solved the issue #227)
self.send_header("Access-Control-Allow-Origin", "*")
def authenticate(self, headers):
# auth = headers.get('Authorization')
try: