mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-07 18:51:34 +03:00
Add Access-Control-Allow-Origin: * to the response header
This commit is contained in:
parent
bd73000765
commit
0fa3d145a5
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user