Allow websocket connections from scripts

scripts don't set origin on connection

we allow these connections on API requests, websockets should match.
Min RK 10 years ago
parent 6df840e19d
commit 8d7e430b89

@ -133,13 +133,9 @@ class WebSocketMixin(object):
if origin is None:
origin = self.get_origin()
# If no header is provided, assume we can't verify origin
if origin is None:
self.log.warning("Missing Origin header, rejecting WebSocket connection.")
return False
if host is None:
self.log.warning("Missing Host header, rejecting WebSocket connection.")
return False
# If no origin or host header is provided, assume from script
if origin is None or host is None:
return True
origin = origin.lower()
origin_host = urlparse(origin).netloc

Loading…
Cancel
Save