Commit 377a3834 by zhengtianbao

Allow CORS request

parent d3da7ec5
...@@ -43,7 +43,8 @@ class InvalidValueError(Exception): ...@@ -43,7 +43,8 @@ class InvalidValueError(Exception):
class MixinHandler(object): class MixinHandler(object):
custom_headers = { custom_headers = {
'Server': 'TornadoServer' 'Server': 'TornadoServer',
"Access-Control-Allow-Origin": "*"
} }
def initialize(self): def initialize(self):
...@@ -326,6 +327,9 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler): ...@@ -326,6 +327,9 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
class WsockHandler(MixinHandler, tornado.websocket.WebSocketHandler): class WsockHandler(MixinHandler, tornado.websocket.WebSocketHandler):
def check_origin(self, origin):
return True
def initialize(self, loop): def initialize(self, loop):
self.loop = loop self.loop = loop
self.worker_ref = None self.worker_ref = None
......
...@@ -49,7 +49,7 @@ def get_app_settings(options): ...@@ -49,7 +49,7 @@ def get_app_settings(options):
static_path=os.path.join(base_dir, 'webssh', 'static'), static_path=os.path.join(base_dir, 'webssh', 'static'),
websocket_ping_interval=options.wpintvl, websocket_ping_interval=options.wpintvl,
debug=options.debug, debug=options.debug,
xsrf_cookies=True xsrf_cookies=False
) )
return settings return settings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment