its 127.0.0.1 not localhost

This commit is contained in:
j 2014-08-12 15:35:50 +02:00
parent 871a602acd
commit b26a22de5d

View file

@ -19,11 +19,11 @@ class Handler(WebSocketHandler):
def check_origin(self, origin): def check_origin(self, origin):
# allow access to websocket from site, installer and loader (local file) # allow access to websocket from site, installer and loader (local file)
return self.request.host in origin \ return self.request.host in origin \
or origin == 'http://localhost:9842' \ or origin == 'http://127.0.0.1:9842' \
or origin == 'null' or origin == 'null'
def open(self): def open(self):
if self.request.headers['origin'] not in ('null', 'http://localhost:9842') \ if self.request.headers['origin'] not in ('null', 'http://127.0.0.1:9842') \
and self.request.host not in self.request.headers['origin']: and self.request.host not in self.request.headers['origin']:
logger.debug('reject cross site attempt to open websocket %s', self.request) logger.debug('reject cross site attempt to open websocket %s', self.request)
self.close() self.close()