mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-08 19:18:11 +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',)
|
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):
|
def authenticate(self, headers):
|
||||||
# auth = headers.get('Authorization')
|
# auth = headers.get('Authorization')
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user