From 9c1c6535822a46f18dc71a55693c841a28698348 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 17 Jan 2016 20:30:19 +0530 Subject: [PATCH] log remote id if versions do not match, allow file:// to access websocket --- oml/nodes.py | 2 +- oml/websocket.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oml/nodes.py b/oml/nodes.py index 4a8feab..2307550 100644 --- a/oml/nodes.py +++ b/oml/nodes.py @@ -193,7 +193,7 @@ class Node(Thread): version = r.headers.get('X-Node-Protocol', None) if version != settings.NODE_PROTOCOL: - logger.debug('version does not match local: %s remote %s', settings.NODE_PROTOCOL, version) + logger.debug('version does not match local: %s remote %s (%s)', settings.NODE_PROTOCOL, version, self.user_id) self.online = False if version > settings.NODE_PROTOCOL: state.update_required = True diff --git a/oml/websocket.py b/oml/websocket.py index d340506..20447d0 100644 --- a/oml/websocket.py +++ b/oml/websocket.py @@ -28,7 +28,7 @@ class Handler(WebSocketHandler): ) def open(self): - if self.request.headers['origin'] not in ('null', 'http://127.0.0.1:9842') \ + if self.request.headers['origin'] not in ('null', 'file://', 'http://127.0.0.1:9842') \ and self.request.host not in self.request.headers['origin']: logger.debug('reject cross site attempt to open websocket %s', self.request) self.close()