diff --git a/oml/websocket.py b/oml/websocket.py index 94c0b94..58160f7 100644 --- a/oml/websocket.py +++ b/oml/websocket.py @@ -16,8 +16,15 @@ logger = logging.getLogger('oml.websocket') class Handler(WebSocketHandler): + def check_origin(self, origin): + # allow access to websocket from site, installer and loader (local file) + return self.request.host in origin \ + or origin == 'http://localhost:9842' \ + or origin == 'null' + def open(self): - if self.request.host not in self.request.headers['origin']: + if self.request.headers['origin'] not in ('null', 'http://localhost: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() if self not in state.websockets: diff --git a/static/html/load.html b/static/html/load.html index 2c0c36f..6206d81 100644 --- a/static/html/load.html +++ b/static/html/load.html @@ -3,24 +3,43 @@ Open Media Library - - + + + + +
+
Starting Open Media Library
+ +